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.

Frequently asked questions

What inputs does it accept?

Queries, mutations, subscriptions, and SDL schemas, minified or irregularly formatted.

Can I control the indent width?

Yes — set anywhere from 2 to 8 spaces.

Does it minify too?

No — for the minify direction use the GraphQL formatter.

How do I get TypeScript types from a schema?

Use the GraphQL to TypeScript converter.
Embed this tool on your site

Free to embed, no attribution required (but appreciated). Paste this where you want the tool to appear: