Indent queries, mutations and SDL, keeping arguments, strings and comments intact.
Arguments stay on their field's line, strings and comments are protected, and a comment never shares a line with code.
A query, a mutation, a fragment or a chunk of schema definition language. Everything collapsed onto one line, which is how queries usually arrive from a log, is exactly the case this handles.
Two spaces is the community convention and four is available if your project prefers it. Selection sets are indented by nesting depth either way.
Arguments stay with their field, aliases and spreads stay on one line, and descriptions and comments get their own lines so nothing is accidentally commented out.
No, it formats. Layout is corrected but syntax is not checked against a schema, so an invalid query will still be laid out neatly. Use your API's tooling for validation.
No. Strings, block strings and comments are captured before any layout work happens, so a brace inside a default value or a description is never treated as structure.
Because a GraphQL comment runs to the end of the line. If it shared a line with a brace, that brace would be commented out and the document would break.
Yes. Type, input, enum and interface definitions format the same way as operations, with fields indented inside their block.
They stay on one line with the field. Breaking arguments across lines is a style choice that different teams take differently, so this keeps them together and predictable.
Not currently. The tool exists to make an operation readable in a review or a ticket, which is the direction people usually need.
No. Formatting runs in your browser, which matters because queries often reveal internal schema and field names.
Yes, completely free with no sign-up.
Free online JSON formatter and validator. Format, minify and validate JSON with syntax highlighting and instant error detection.
Open ToolFormat messy SQL into readable queries with proper clause breaks and keyword casing, without touching string literals.
Open ToolGenerate TypeScript interfaces from a JSON payload, with named interfaces for nested objects.
Open Tool