This article wil outline steps to follow in order to connect GraphiQL (An in-browser IDE for exploring GraphQL) to your London instance.
There are 3 pieces of info required to achieve this:
- An Endpoint
- A user token for authentication
- A cookie (or rather the contents of a certain cookie)
The endpoint you can get by following this syntax: https://<instance-name>.service-now.com/api/now/graphql
The User token and cookie can be gathered using Chrome DevTools. Follow these steps:
- HOP onto a London instance with Agent Workspace enables as a Maint user
- Open Agent Workspace
- Open Chrome DevTools for the page you have Workspace on
- In DevTools, go to the Network tab
- In Workspace, open an Incident record
- Back in Devtools, look towards the bottom of the requests list (the latest) for one titled "graphql". Open it
- Open the Headers tab and scroll down to the "Request Headers" section
- Get the "x_usertoken" and "Cookie" values
Now open GraphiQL and put your endpoint into the text box at the top
Make sure the Method is set to POST. Open "Edit HTTP Headers"
Create the Headers in the screenshot below with the values retrieved from DevTools. Also, add a "Connection" header and set it to "keep-alive"
Save the values and close the Headers menu. GraphiQL should now automatically connect to your instance (may take about 15 seconds to load due to the Documentation Explorer)
- The User token and Cookie are new for every session. You will need to get the new values from DevTools and add them to GraphiQL every time you start a new session (i.e. when you logout or your session times out)
- This method only works for Maint users as is. If you try this as an Admin you will receive the following error message