GraphQL Formatter

Format GraphQL queries, fragments and schema definitions.

Input

Processed on your device

How to use GraphQL Formatter

Lay out GraphQL fields, arguments and nested selection sets so the query or schema source is easier to review.

  1. Paste GraphQL or open a .graphql or .gql file.
  2. Choose Indentation and format, then inspect the nesting in the new source.
  3. Select Format and review the result.
Example input
query Inventory { items(first: 5) { id name quantity } }

Example use

Review a query with several nested objects to confirm requested fields appear inside the intended selection sets.

Output and compatibility

Parsing a document is different from validating it against your GraphQL service schema. The tool does not issue requests or check actual field availability.

Troubleshooting

If source fails to format, check unclosed selection sets and whether it includes template expressions from another language.

Use JSON Formatter to inspect a JSON response alongside the query.

Frequently asked questions

Will it execute a GraphQL request?

It reformats the supplied document as text.

Does it check if the fields exist on my API?

That requires the API schema and its validation tools.

Find a tool