GraphQL Formatter
Format a GraphQL query, mutation or fragment with one field per line, or minify it for a GET request, with strings and comments left intact.
Free · No sign-up · Your inputs stay in your browser
Input
Format or minify a GraphQL query
Output
GraphQL
404 characters
A layout pass over the tokens: one field per line, arguments kept on the field's line, strings and block strings untouched. Minifying drops comments and the insignificant commas the spec allows. It checks that braces balance; checking fields against a schema needs the schema.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Readable queries, small requests
Queries copied from logs, network panels or code arrive on one line. Formatted, the nesting shows which fields belong to which type. For persisted queries and GET requests, a minified query keeps URLs short. The GraphQL specification treats commas as insignificant, which is why both forms are equivalent.
What it does not check
Formatting reads the syntax, not your schema. A field that does not exist or a wrong argument type is only caught by validating against the schema, which GraphQL servers do before executing, and which GraphiQL and graphql-language-service do in editors.