Handitab

GraphQL Minifier

Minify a GraphQL query or schema by removing comments, commas, line breaks, and extra spaces so it fits on one line in a request body.

About GraphQL Minifier

GraphQL is a query language for APIs in which the client lists the exact fields it wants. This tool splits your document into tokens and prints it again: formatting puts each field on its own line, indents by nesting depth, and keeps arguments on one line, while minifying removes comments, commas, and unneeded whitespace. It checks that braces and parentheses are balanced but does not validate field names against a schema.

How to use GraphQL Minifier

  1. Type or paste into the "GraphQL" box, or press "Use example" to try it with sample data.
  2. Set "Action" and "Indent" if the defaults do not fit.
  3. The result appears below and updates as you type.
  4. Copy the result with the copy button, or download it as a file where that is offered.

Questions about GraphQL Minifier

Are commas required in GraphQL?

No. The GraphQL specification treats commas as insignificant, like whitespace. They may appear between fields or arguments for readability, but removing them does not change the meaning, which is why the minifier drops them.

Runs in your browser. Page last updated .

More developer tools

All 41 developer tools