How to make a GraphQL query with an Authorization Bearer Token in Postman
A step by step tutorial on making a GraphQL API that uses an authorization bearer token in Postman.
The following tutorial walks you through how to make a GraphQL API call that uses an authorization token in Postman to gather Subscribers from a Craft CMS.
It assumes that you have setup your server to work with GraphQL, that there is a schema with relevant data for it to read and that it uses a token. For tutorials on how to do so in Craft CMS, please consult the links below.
Step One: Determine your Query
Navigate to the GraphiQL of your server and use the explorer to create a query.
Step Two: Setup Postman
Open Postman and create a new HTTP request that makes a POST request to your GraphQL API.
Step Three: Setup Authorization Bearer Token
Select the Authorization tab.
Subsequently select Bearer Token from the Type dropdown.
Finally, add your token in the Token input.
Step Four: Set the GraphQL query
Select the Body tab.
Subsequently select GraphQL from the underlying radio buttons.
Finally, add your GraphQL Query in the Query section.
Step Five: Send
Press the Send button on the top right.
The response will appear beneath the GraphQL Query.
We are actively looking for feedback on how to improve this resource. Please send us a note to firstname.lastname@example.org with any thoughts or feedback you may have.