How to use the GraphQL Formatter & Validator
- Paste a GraphQL query, mutation, subscription, fragment or schema (SDL).
- It is formatted as you type; syntax errors show the line and column.
- Optionally open Validate against a schema and paste your SDL to check every field and argument.
- Copy the formatted or minified result.
What the validator checks
Without a schema the tool checks syntax: balanced braces, valid names, argument and variable syntax, string and block-string escapes. With a schema it runs the full set of GraphQL validation rules from the specification, the same rules a GraphQL server applies before running a query:
- Every field exists on its type, and leaf fields (scalars, enums) have no selection set while object fields do.
- Arguments exist, required arguments are provided and values have the right type.
- Variables are declared, used, and their types fit where they are used.
- Fragments are used, match the type they are spread on and don’t form cycles.
- Operation names are unique and anonymous operations stand alone.
Formatting and minifying
Formatting uses the reference print function from graphql-js, so the output matches what most GraphQL tooling produces: two-space indentation, one field per line and normalised argument spacing. Minifying strips comments and insignificant whitespace — useful for GET requests and persisted queries where every byte counts. Need to build a query from a schema? Use the GraphQL query builder.
Tools that pair well with the GraphQL Formatter & Validator
- JSON Formatter — Paste JSON to pretty-print, minify or validate it.
- OpenAPI / Swagger Validator — Paste an API specification to check it against the official OpenAPI schema, catch broken references and inconsistent path parameters, and see every endpoint at a glance.
- JSON Schema Validator — Paste a schema and some JSON to see exactly which values break which rule — or generate a starting schema from example data.
- Webhook Tester — Get a unique URL, point any webhook or HTTP client at it and watch requests arrive in real time — headers, query string and pretty-printed body, plus HMAC signature checks.
Frequently asked questions
Does it support schema files (SDL)?
Can it fetch my schema from an endpoint?
rover graph introspect, get-graphql-schema or from your server’s code.