UtilityToolsLab

© 2026 UtilityToolsLab. Built and maintained by the UtilityToolsLab Team.

About·Changelog·Privacy Policy·Terms of Service·Contact
HomeAPI & HTTP ToolsGraphQL Formatter

Related Tools

cURL Builder

GraphQL Formatter — Format & Validate

Format, minify and check GraphQL queries, mutations and schemas in your browser. Find syntax errors by line and column, and keep your comments intact.

You Might Also Like

All API & HTTP Tools

cURL Builder

Build a cURL command from a form: pick a method, add headers, set Bearer / Basic / API-key auth, attach a body, toggle flags, and copy the shell-ready command.

Case Converter

Convert text to UPPERCASE, lowercase, Title Case or Sentence case, or to camelCase, PascalCase, snake_case and kebab-case for code. Paste and copy.

Lorem Ipsum

Placeholder text in 20 languages — English, Bengali, Hindi, Arabic, Spanish, French, Chinese and more. Paragraphs, sentences, words, lists, optional emoji.

English Lorem Ipsum

Generate free English Lorem Ipsum dummy text for web design, layouts, and mockups. Classic Latin filler text in paragraphs, sentences, words, or lists.

A GraphQL query copied from a network tab or a log arrives as one long line, with escaped quotes and no shape. Paste it here and it comes back indented, one field to a line, with its comments still where you put them. If it does not parse, you get the line and column of the problem.

The box starts with a one-line query beginning query VesselReport($port: String!, …, which formats into a readable block with its CargoFieldsfragment below it.

How to Use the Formatter and Minifier

  1. Paste a query, mutation, subscription, fragment or schema into the left box. It updates as you type.
  2. Stay on Format and choose 2 spaces, 4 spaces or a tab, or switch to Minify for the smallest valid text.
  3. Read the summary: operations, fragments, type definitions, fields selected and the deepest nesting.
  4. Press Copy or Download .graphql.

The summary also catches mistakes a formatter normally ignores: a fragment that is used but not defined, one defined but never used, a repeated operation name, and an unnamed operation sharing a document with others. Deepest nesting is a quick check before a query reaches a server that limits depth.

Format Notes: What Is Changed and What Is Kept

Formatting changes layout only. Commas, which GraphQL ignores, are tidied; comments and triple-quoted descriptions stay. Arguments stay on one line up to 80 characters and then wrap to one per line. Minifying removes comments and every optional space, leaving a space only where two words would otherwise merge, so query Q keeps its space. The parser covers queries and the schema language, and was tested against the official graphql-js parser on 80,000 mutated documents: it accepted and rejected exactly the same ones, and each valid result parsed back to the same document.

Accuracy: Syntax Is Not the Same as Valid Against a Schema

This checks that the document is well-formed, not that it will run. It has no schema, so a misspelled field or a wrong argument type passes here and fails on the server. An error reads like “Line 1, column 14: Expected a value, found ")".” and points at the first problem only, since one missing brace can make everything after it meaningless. Text stays in your browser, so a query with a token in it goes nowhere, though it is saved locally for your next visit.

Operations

1

Fragments

1

Type definitions

0

Fields selected

10

Deepest nesting

3

  • query VesselReport, 3 variables