Skip to content
Convertto

GraphQL Formatter

Format or minify a GraphQL query, mutation or schema, and inspect its depth.

A GraphQL formatter indents a query, mutation or schema so its selection sets are readable, or minifies it by stripping every optional space. Because it tokenises rather than pattern-matching, braces inside string literals and comments cannot corrupt the indentation.

Runs in your browser
Privacy
Runs entirely in your browser — nothing is uploaded
Cost
Free, unlimited, no sign-up

Frequently asked questions

Does formatting change how a query executes?

No. Whitespace is insignificant in GraphQL, so formatting affects only readability. Minifying reduces the bytes sent, which matters for queries embedded in a mobile client but not for a server-to-server call.

Why do servers limit query depth?

Because GraphQL lets a client request arbitrarily nested data, and a deeply recursive query can force the server to resolve millions of records from one small request. A depth limit of 7 to 10 is the standard defence.

How to use the graphql formatter

  1. 1Enter or paste your graphql.
  2. 2Choose the mode.
  3. 3Set the indent.
  4. 4The result appears immediately — copy or download it.

Embed this tool

Put the working graphql formatter on your own site. It runs in your visitors' browsers exactly as it does here — free, no account, nothing uploaded.

Share this tool

Last updated

More developer tools