Set up Postman with GraphQL client
This guide will help you set up a new collection with a new GraphQL request.
Install
Postman offers a great guide for downloading and installing the client, you can find it here.
Setup
We recommend you to use something called a collection in Postman to group your upcoming queries and use collection variables.
The steps below will help you set up a new GraphQL query request and a collection at the same time.
Creating a new request
- Almost at the top of the Postman windows, under Workspace, click on New and then select GraphQL.
- Click on Save in the upper right corner, give the Request a name, maybe MyFirstRequest and then click on New collection at the bottom of the windows.
- Give the new collection a name, maybe EasitGO-Test-GraphQL.
- Click on create and then save at the bottom of the windows.
-
Before we do anything else, click on the collection we just created in the left pane and click on Variables. Here you should add two variable, url and apikey.
- url - Initial value should be [urltoEasitGO]/graphql/
- apikey - Your API-key.
-
When you have entered the variables and saved, go back to the request you created in step 2 and click on Authorization. Set Type to Bearer Token and enter the variable like this, {{apikey}}.
- Click on Query and enter the url variable in the URL field ({{url}}).
- Give Postman a second to load the schema from the URL and should see a list of query operations.
- Tick and then click on Query in the upper right corner and you should get a response in the bottom pane.
Congratulations, you have successfully made your first query request.