Format GraphQL queries, mutations, subscriptions, and schema SDL with the official graphql-js printer. Line-precise error messages. 100% browser-based.
The GraphQL Formatter is powered by the official `graphql-js` library's `parse` + `print` pipeline — the same canonical formatter used by Apollo Studio, GraphQL Playground, and `graphql-ws`. It formats queries, mutations, subscriptions, fragment definitions, inline fragments, and Schema Definition Language (SDL) with consistent indentation and field alignment. Because it uses the official parser directly (not a third-party formatter), error messages include exact line and column information. All processing is synchronous and runs in the browser without any server round-trip.
QWhich GraphQL specification does this support?
The official GraphQL June 2018 and October 2021 specifications, as implemented by graphql-js 16.x — including SDL, schema extensions, @defer/@stream directives, and all standard built-in types.
QCan it format SDL (schema definitions)?
Yes — type definitions, input types, enums, interfaces, unions, scalars, directives, schema extensions, and `extend type` declarations are all formatted correctly.
QIs my schema or query sent to a server?
No. All formatting runs locally in your browser synchronously. Nothing is transmitted to any server.
QWhat does the formatter do with fragments?
Named fragment definitions and inline fragments are formatted with the same indentation and field alignment as regular selections. Spread operators (...FragmentName) are preserved on their own lines.