GraphQL Formatter
Format GraphQL queries, mutations, fragments and schema definitions instantly.
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.