GraphQL Formatter
GraphQL formatter tool. Format GraphQL queries and variables, check syntax. Searchable as graphql formatter, graphql format.
2
GraphQL Query
Variables
GraphQL Query Result
Read Only
Variables Result
Read Only
How to use
About this tool
Formats GraphQL queries and variables and checks syntax. Searchable as graphql formatter, graphql format.
How to use
Enter GraphQL query and variables (JSON) or load from file. View and copy formatted output. Syntax errors show location.
Use cases
• Improving GraphQL query readability • Debugging syntax errors • Formatting variables (JSON) • Query verification during API development
How it works
■ What is GraphQL? GraphQL is a query and schema language for APIs. Clients request only the data they need, avoiding REST over-fetching. It supports queries, mutations, and subscriptions; variables pass parameters.
FAQ
- Q: Does this tool support GraphQL variables?
- A: Yes. Paste the query in the query field and JSON variables in the variables field. Both are formatted independently and syntax errors in either are reported.
- Q: What types of GraphQL documents are supported?
- A: Queries, mutations, subscriptions, fragments, and schema definitions (SDL) are all supported.
- Q: Can I use this to validate a query before sending it to an API?
- A: The tool checks GraphQL syntax, so structural issues (missing braces, invalid keywords) are detected. It does not validate against a specific schema, so field name errors will not be caught.
- Q: Why is the formatted output different from what my IDE produces?
- A: Different formatters may make different style choices (e.g., blank lines between fields). This tool follows the standard GraphQL formatting conventions used by the graphql-js reference library.
- Q: Does this tool send my query to a server?
- A: No. All formatting and syntax checking is done in the browser. Your query and variables are never sent to any server.
