Why it matters
GraphQL queries copied from logs and network panels arrive minified, and long queries with nested fragments are hard to review. Deep or very wide queries are also a common cause of slow APIs, and servers often reject them with a depth limit.
This tool parses GraphQL with a lexer and parser written for this site, prints it cleanly and reports depth, field count and unused fragments or variables, so you can see whether a query is likely to hit your server's limits before you send it.
How it works
- InputA query, mutation, fragments or schema
- In your browserParsed and checked for unused and missing parts
- OutputFormatted or minified GraphQL with depth
Where it fits in a designer's workflow
- Plan
- Design
- Build
- Test
- Launch
By the numbers
Show the numbers as a table
| Version | Bytes |
|---|---|
| As pasted | 325 |
| Formatted | 501 |
| Minified | 277 |
How to use it
- Paste a query, mutation or schema.
- Choose format or minify and the indent.
- Fix any syntax error at the line shown.
- Check the depth and complexity notes, then copy the result.
FAQ
Does it check my query against a schema?
No. It checks the syntax and structure. Field names are only validated by your server's schema.
What depth is too deep?
Many servers limit depth to between 7 and 15. Beyond that, a query is likely to be slow or rejected.
Can I format schema files?
Yes. Type definitions, enums, inputs, interfaces, unions, directives and descriptions are all formatted.
Is the query sent anywhere?
No. It's parsed in your browser.