Sending GraphQL requests using Postman

Sherry Hsu
2 min readDec 7, 2018

--

Softwares have bugs. Sometimes when we use our system, we notice an error or something unexpected returned on the UI. It is often easier to investigate by sending in the specific problematic request to the server.

What is the easiest way to send the specific GraphQL request to the server via Postman?

  1. Copy the gql query from the developer console as cURL
  2. import the cURL to Postman
Copy GraphQL gql queries as cURL from Chrome developer tool
Import the request to Postman by pasting the cURL

Da La! Now you can send GraphQL request of interest to server directly using Postman.

Correct headers and body filled in Postman after the import

Notice there are lots of \n in the query. We can find and replace them in a text editor like VS Code.

In VS Code, we can open the ‘find and replace’ mode, and check the option ‘Use regular expression’. In the Find input, enter \\n . In the Replace input \n . All of the \n would be changed to new line.

You can also copy and paste the prettified queries to tools like GraphQL Playground and send requests to server!

GraphQL Playground example

--

--

Sherry Hsu
Sherry Hsu

Written by Sherry Hsu

A software engineer passionate about learning and growth

No responses yet