forked from segmentio/segment-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraphql.js
30 lines (26 loc) · 1.48 KB
/
graphql.js
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
const getWorkspaces = () => {
const options = {
"headers": {
"accept": "*/*, application/json",
"accept-language": "en-US,en;q=0.9",
"content-type": "application/json",
"sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"96\", \"Google Chrome\";v=\"96\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"x-requested-with": "fetch",
"x-timezone": "America/Los_Angeles",
},
"referrer": "https://app.segment.com/workspaces",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": "{\"operationName\":\"getWorkspaces\",\"variables\":{},\"query\":\"query getWorkspaces {\\n workspaces: workspaces {\\n id\\n slug\\n name\\n isCurrentUserOwner\\n isCurrentUserExemptFromSSO\\n sso {\\n defaultAuth0ConnectionId\\n auth0ConnectionIds\\n isForced\\n __typename\\n }\\n owners {\\n id\\n __typename\\n }\\n lockouts {\\n workspaceId\\n reason\\n message\\n createdAt\\n __typename\\n }\\n billing {\\n isOnStartupProgram\\n isFreeAccount\\n __typename\\n }\\n __typename\\n }\\n}\\n\"}",
"method": "POST",
"mode": "cors",
"credentials": "include"
}
const workspaceResponse = fetch ("https://app.segment.com/gateway-api/graphql", options)
console.log(workspaceResponse)
}
getWorkspaces()