GraphQL Formatter

Format GraphQL queries and schema definitions

Runs in your browserUtility01Formatters & Validators

What is GraphQL Formatter?

A GraphQL formatter expands queries, mutations, and schemas that have been collapsed onto a single line into properly indented code, ready for reading and code review. Parsing is built on Prettier's GraphQL parser and runs locally in your browser.

How to use GraphQL Formatter

  1. 1Paste a query, mutation, fragment, or schema definition.
  2. 2The output is indented by selection-set depth, with arguments and directives left in place.
  3. 3Syntax errors report their exact position, so you can fix them and format again.

Frequently asked questions

Can it format queries and schemas at the same time?+

Yes. The GraphQL query language and the Schema Definition Language (SDL) share the same lexical grammar, so the formatter recognizes and handles both: type, input, and enum definitions indent just as correctly as a query does.

Does formatting change what the query means?+

No. Formatting only adjusts whitespace and line breaks; it never adds or removes fields, reorders arguments, or touches aliases. The query you send to the server is semantically identical before and after.

Related tools

All tools