🚀 New: Run requests via webhooks. Learn more
Enter a GraphQL query to convert it to a JSON body for a POST request.
If you're connecting to a GraphQL server using HTTPS requests, the server probably expects you to send a POST request with the query in the JSON body like this:
{ "query": "query { countries { code name emoji capital continent { name } currency } }" }So you need your GraphQL query to be in this format to send it to the server.
Unfortunately, most GraphQL API docs/ playgrounds just give you straight GraphQL queries like this:
query { countries { code name emoji capital continent { name } currency } }You cannot use this directly in the request body as it is not valid JSON.
{ "query": "query { countries { code name emoji capital continent { name } currency } }", "operationName": "...", "variables": { "myVariable": "someValue", ... } }
Having trouble? Try clicking the 'Beautify' button to validate and format your query. You will be shown any errors.