Handytool
DeveloperFreeRuns locally

GraphQL formatter

Pretty-print and validate GraphQL queries, mutations, and schemas — privately in your browser.

.graphql.gql
GraphQL input
0 lines0 bytes
Formatted query
0 lines0 bytes

About the GraphQL formatter

Handytool's GraphQL formatter parses any GraphQL document — queries, mutations, subscriptions, or SDL schema definitions — using the official graphql.js parser, then re-emits it with consistent indentation. The Validate button confirms the document parses without rendering it. Everything runs locally, so it's safe to format internal API queries or proprietary schemas.

GraphQL formatter features

  • 01

    Official graphql.js parser

    The same parser the GraphQL reference implementation ships with. Errors come with the exact line and column, and formatting is canonical.

  • 02

    Queries, mutations, and SDL

    Operation documents and schema definitions both work. Type definitions, directives, and descriptions round-trip cleanly.

  • 03

    Validate without running

    Validate just confirms the document parses. It doesn't execute the query, doesn't need a schema, and doesn't make network calls.

GraphQL formatter FAQ

Does this validate against a schema?
No — only syntactic validation. Schema-aware validation needs the target schema to compare field names and argument types; this tool only confirms the document parses.
Will it preserve my comments?
GraphQL comments (lines starting with #) are stripped by the parser. To keep documentation, use """description""" string literals on type and field definitions — those round-trip correctly.
Which GraphQL spec version does this support?
The current October 2021 spec, including features like OneOf input objects and the @specifiedBy directive.
Is the query uploaded anywhere?
No. The graphql.js parser runs entirely in your browser — your operations stay on your device.

Related tools

Developer

Explore other tools

All tools