-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuserInformation.js
More file actions
36 lines (31 loc) · 915 Bytes
/
userInformation.js
File metadata and controls
36 lines (31 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
Our sample code uses the graphql-request module, you can alter it to use whatever
graphQL library you wish, such as Apollo. We have also omitted exception handling for clarity but
you should catch security exceptions and handle them appropriately for your use case.
*/
import { GraphQLClient } from 'graphql-request'
import getToken from './legalesign.js';
const token = await getToken(process.env.LEGALESIGN_EMAIL, process.env.LEGALESIGN_PASSWORD)
const client = new GraphQLClient(
process.env.LEGALESIGN_GRAPHQL_URL || "https://graphql.uk.legalesign.com/graphql",
{ headers: {'Authorization': token}}
);
const results = await client.request(`query ViewMyDetails {
user {
id
name
email
memberConnection {
groupMembers {
id
name
group {
id
name
}
}
}
}
}`);
// The returned JSON
console.log(results);