Although it was possible to use GraphQL with Postman, it wasn’t really supported out-of-the-box… until today. With the release of Postman 7.2 GraphQL is now officially supported. Sending GraphQL queries in the request body, using GraphQL variables, and GraphQL query autocompletion, … it all becomes available inside Postman.
Getting started
- Create a new request in Postman
- Enter a GraphQL endpoint for the url e.g. https://spotify-graphql-server.herokuapp.com/graphql
- Select POST as your HTTP method
- Go to the Body tab and select GraphQL
- Select the GraphQL radio button
- Now you can enter your GraphQL query and hit SEND:
Notice that the UI mentions 'no schema' and that you don’t get autocompletion out-of-the-box. To enable this you have to add the GraphQL API schema to Postman:
- Go to the APIs tab in Postman
- Click on the + New API button on the left
- Name your API
- Select GraphQL as your spec from the dropdown menu on the Define tab
- Add your schema and save
More information: https://blog.getpostman.com/2019/06/18/postman-v7-2-supports-graphql/