Docelora
ToolsAboutContact
Developer tools

GraphQL Formatter

Clean up a GraphQL query copied from a network log, check a schema file for syntax errors, or shrink a query for a GET request.

Quick answer: paste a query, mutation or schema. It is checked and formatted as you type; choose Minify to strip all spacing instead.

GraphQL Formatter

Queries · mutations · SDL · minify

Private: everything is processed in this browser tab and never uploaded.

Before and after

InputFormatted
{user(id:1){name}}{ user(id: 1) { name } } on separate indented lines
query Q($a:Int){x(a:$a)}query Q($a: Int) { x(a: $a) }

Related tools

Frequently asked questions

What does the formatter check?

The GraphQL syntax: brackets, arguments, variables, fragments, directives and type definitions. It does not check field names against your API’s schema – that needs the schema itself.

Can it format schema files (SDL)?

Yes – type, interface, enum, input, union, scalar, directive and extend definitions are all supported.

Why were my comments removed?

The formatter rebuilds the document from its syntax tree, and # comments are not part of that tree. Descriptions in quotes ("…" or """…""") are kept.

What does minify do?

It removes every space, line break and comma that GraphQL does not need – useful for queries sent in URLs or stored compactly.

Which library is used?

The official graphql-js reference implementation (version 16), the same parser most GraphQL servers use.

Why is my query invalid?

Common causes are a missing closing bracket, a variable without $, a fragment spread to an undefined name, or commas inside selection sets copied from JSON.

Does it support subscriptions?

Yes – query, mutation and subscription operations are all formatted.

Are multiple operations allowed?

Yes – a document can contain several operations and fragments.

Can I use it for Apollo or Relay queries?

Yes – they use standard GraphQL syntax.

Is my query sent anywhere?

No – it is parsed in your browser.

What is the difference between a query and a mutation?

Queries read data; mutations change it. Both are written in the same syntax.

Is it free?

Yes – no sign-up, no limits and no watermark.

Is my input uploaded?

No. Everything runs in your browser tab; nothing you paste or open is sent to Docelora.

Can I use the output in commercial projects?

Yes. What you generate is yours to use however you like.

Does it work on a phone?

Yes – the layout adapts to small screens, though long code is easier to work with on a larger display.

How do I copy the result?

Use the Copy button under the result, or Download to save it as a file.

Which browsers are supported?

Current versions of Chrome, Edge, Firefox and Safari.

Do I need to install anything?

No – it runs in your web browser, and any library it needs is loaded from Docelora the first time you use it.

Is my input kept after I close the page?

No – copy or download the result before closing the tab.

Can I suggest an improvement?

Yes – use the Contact page to tell us what would make the tool more useful.

Last reviewed: 16 November 2026.