GraphQL Query Prettifier
Take messy GraphQL queries (especially those minified for network transit) and reformat with consistent indentation and field grouping. Works on queries, mutations, subscriptions, and schema SDL.
How to use the GraphQL Query Prettifier
Paste a GraphQL query, mutation, subscription, or SDL schema — minified or messy — set the indent width, and the prettified version appears below, ready to copy.
Prettifying minified GraphQL
GraphQL operations are often minified to a single line before they are sent, which is efficient on the wire but unreadable when you pull one out of a network log or a client cache to debug it. Restoring the structure means re-indenting nested selection sets, fragments, and arguments so the shape of the query is visible again.
This expands a compact or messy GraphQL document into clean, consistently indented form, with an adjustable indent width, across queries, mutations, subscriptions, and schema SDL. It is the prettify-focused counterpart to the GraphQL formatter, which also minifies; once a schema is readable, generate types from it with the GraphQL to TypeScript converter.
Common use cases
- Debug a logged query — expand a single-line operation from a network trace.
- Inspect a cached doc — make a client’s stored query readable.
- Pick an indent — set 2-8 spaces to match your codebase.
- Tidy hand-written GraphQL — normalise erratic indentation.
- Schema reading — indent an SDL block for review.