GraphQL Formatter
Format GraphQL queries, mutations, fragments and schema definitions instantly, entirely in your browser.
What is GraphQL? Read our guide →Why format GraphQL?
A GraphQL query minified into one line by a client library or browser devtools network tab is hard to read, especially with nested selections and fragments. This formatter parses the document into an AST with the reference graphql-js parser and re-prints it with consistent 2-space indentation, so any nesting depth stays readable.
One formatter, every document type
GraphQL uses the same syntax family for operations and schemas, so a single parse-and-print pass handles all of them: queries, mutations, subscriptions, fragments, and SDL type definitions (type, input, enum, interface).
Common use cases
Paste a minified query copied from a network tab or a GraphQL Playground/Apollo Studio history entry to make it readable before pasting it into a PR description or documentation.
Backend developers use it to clean up SDL pasted from a schema-first API definition. Everything runs locally, so it is safe to paste queries containing internal field or type names.
Frequently asked questions
No. The reference parser builds an AST from your document and the printer regenerates text from that AST alone; a # comment carries no meaning in GraphQL's type system, so it's dropped rather than preserved, the same way whitespace and blank lines are also not literally preserved between passes.