GraphQL Formatter & Validator
Format queries and SDL schemas, catch syntax errors by line, and validate a query against a schema.
Your Data Never Leaves Your Device
Every tool runs entirely in your browser. Nothing you type is uploaded, stored, or logged on our servers.
The GraphQL Formatter & Validator parses a document into an AST and prints it back in canonical form, which normalises indentation and spacing and — usefully — proves the document parses at all. When it does not, the syntax error is reported with its line and column rather than a bare message.
Formatting only catches syntax. Enabling schema validation catches the class of problem that actually reaches production: fields that don't exist on a type, wrong or missing arguments, and invalid fragment spreads. A query can be perfectly well-formed and still be rejected by the server for all of those. Schema mode does the equivalent for SDL, building the schema so invalid type references surface too. Everything runs in your browser on the reference graphql-js implementation.
FAQ
The document is parsed into an AST and printed back out, so indentation and spacing are normalised to the canonical form. A side effect worth having: if it formats, it parses — a syntax error is reported with its line and column instead.
Query mode handles executable documents — queries, mutations, subscriptions, and fragments. Schema mode handles SDL type definitions and prints them back through the schema builder, which also catches invalid type references.
Everything a syntax check cannot: fields that do not exist on a type, wrong argument names or types, missing required arguments, and invalid fragment spreads. A query can be perfectly well-formed and still be rejected by the server for these reasons.
No. Formatting and syntax checking need only the document. The schema pane is optional and appears when you enable validation.
Block descriptions in SDL are preserved because they are part of the AST. Ordinary # comments are not, since GraphQL treats them as ignored tokens that never reach the syntax tree.
No. Parsing, printing, and validation all run in your browser using the reference graphql-js implementation.