GraphQL Minifier & Syntax Validator

Validate GraphQL documents and shrink them for storage or persisted queries, with errors that point to the exact spot.

Use the tool

Why this tool exists

The parser covers the GraphQL grammar for operations, fragments, variables, directives, values, and type-system definitions (schema, scalar, type, interface, union, enum, input, directive, extend). Minifying removes comments, commas and extra whitespace and keeps a single space only where two names would merge; strings and block strings are left unchanged.

It validates syntax only, not whether fields exist in a schema. Results agree with graphql-js on the valid and invalid documents used in testing: minified output parses to the same AST as the original.

No data is sent anywhere: the work happens in your browser, so you can use it offline once the page has loaded.

How to use it

  1. Paste a query or schema.
  2. Choose validate or minify.
  3. Fix the reported line and column if there is an error.
  4. Copy the minified text for use as a persisted query.

Frequently asked questions

Does it check against my schema?

No, only syntax. Schema validation needs your type definitions.

Are descriptions preserved?

Yes. Block strings and quoted descriptions are kept as they are.

Why remove commas?

Commas are insignificant whitespace in GraphQL, so minified queries omit them.

Is my data sent anywhere?

No. Everything is processed in your browser, and the page makes no network requests with your input.