Turn a GraphQL Query into REST Endpoints
Paste a GraphQL query above and you get the REST requests that would fetch the same data: a GET path for each root field with its arguments as URL-encoded query parameters, a POST with a JSON body for each mutation, related endpoints for nested field selections, and the response shape. It is handy when you are designing a REST API next to a GraphQL one, or explaining a GraphQL query to someone who thinks in HTTP methods.
How to Convert GraphQL to REST — Step-by-Step
Input Your GraphQL Query
Planning a REST API that covers the same data as your GraphQL API? Or need to understand how a GraphQL query maps to REST? Paste your query from any source.
.graphql or .gql fileHow the Query Is Read
The converter maps GraphQL concepts to RESTful conventions:
/api/users)?status=active&limit=25)/api/users/:userId/posts)POST requests with the arguments as a JSON bodyCopy or Download
Frequently Asked Questions
How does a GraphQL query map to REST?
Each top-level field becomes a path under /api, so users(status: "active", limit: 25) { id name } turns into GET /api/users?status=active&limit=25. The fields you select become the response shape, written as JSON with "..." where a value would go. The page only reads the query text; it has never seen your schema or resolvers, so the paths are a suggestion you will probably rename.
What happens to nested fields?
A nested field with its own selection, like posts inside users, is listed as a related endpoint such as GET /api/users/:userId/posts, and it keeps its own arguments as query parameters. Deeper levels follow the same pattern. In the response shape every nested selection is shown as a list, because the query alone cannot tell a single object from a list.
How are lists, objects and special characters written in the URL?
Every value is URL-encoded, so quotes, spaces, &, #, % and characters like José or emoji come back unchanged when the server decodes them. A list repeats the key (tags=a&tags=b) and an input object uses brackets (filter[status]=ACTIVE). Null values are left out, since a query string has no way to say null; a note at the top of the output tells you when that happens.
What about mutations, variables and fragments?
A mutation becomes a POST request whose arguments are sent as a JSON body. A $variable uses its default value from the query; without one it is shown as a {name} placeholder for you to fill in. Fragments and inline fragments are expanded into the fields they contain. Subscriptions are refused, as they stream events and have no single REST request.
Are long IDs and decimals kept exactly?
Yes. Numbers are copied from your query text instead of being turned into JavaScript numbers, so an ICCID like 8901240544102066246 keeps every digit and 14.50 keeps its trailing zero, in the URL and in a JSON body alike. A quoted value such as "00501" stays a string.
Is my query sent anywhere?
No. The query is parsed and converted in your browser and is not uploaded or kept. Reloading the page starts again with an empty editor.
Working with GraphQL in other places? Try GraphQL to SQL, MongoDB to GraphQL, SQL to GraphQL or the GraphQL Formatter.
Related Tools
GraphQL Query Formatter
Format and beautify GraphQL queries and schemas with syntax highlighting
GraphQL Schema Validator
Validate GraphQL schemas with syntax and structure checking
GraphQL Fixer
Fix broken GraphQL queries and schemas automatically, repair syntax errors and malformed types
GraphQL to TypeScript
Generate TypeScript types from GraphQL schemas and queries
GraphQL Minifier
Compress and optimize GraphQL queries for production
GraphQL to JSON Schema
Convert GraphQL schemas to JSON Schema format