DEVELOPER TOOLS
GraphQL Query Formatter & Validator
Format GraphQL documents with GraphQL.js and optionally validate a query against SDL you provide. No endpoint is contacted and no query is executed.
LOCAL GRAPHQL.JS PROCESSING
Format and optionally validate
Paste a query, mutation, subscription, or other GraphQL document. Input limit: 100,000 characters.
Optional: validate against a schema (SDL)
Provide the schema definition text only. Schema input is parsed locally with GraphQL.js; it is not fetched from an endpoint. Input limit: 100,000 characters.
Formatted GraphQL
Schema validation
No schema was supplied. The document was parsed and formatted, but schema validation was not performed.
No validation errors found for the supplied schema.
The document has validation errors for the supplied schema.
This tool runs GraphQL parsing, printing, schema building, and validation in your browser. It never calls an API endpoint or sends your query or SDL to a server.
GraphQL query formatter and validator guide
GraphQL documents are easier to review when operations, arguments, fragments, and selection sets have a consistent layout. This tool parses and formats the document in your browser, and it can optionally validate the operations against a schema that you paste alongside the query.
Formatting checks syntax; schema validation checks whether fields and arguments exist and are used in the expected way. Neither step sends a request, executes a resolver, or proves that a remote GraphQL service is available.
Format a document without changing its intent
Paste a GraphQL operation or a document containing several operations and fragments. The formatter prints a normalized representation with predictable indentation, which can make nested selections and fragment spreads easier to scan in a pull request or debugging session.
A formatter is not a query optimizer. It preserves the parsed document structure rather than choosing a more efficient query, changing resolver behavior, or deciding which fields your application should request. Keep variables and operation names with the document when you need to review how a client supplies values.
Validate against the schema you intend to use
When you provide GraphQL Schema Definition Language, the validator can compare the parsed document with that local schema. It checks selections, arguments, fragments, operation types, and other rules defined by the schema, then reports parser or validation locations so you can find the relevant line and column.
Validation is only as current as the schema you paste. A stale schema can report a real field as unknown or accept a field that has already been removed from production. Custom directives and server-specific behavior may also need the service team’s tooling. If you omit a schema, the document can still be formatted and syntax-checked, but field names cannot be checked against an API contract.
Protect the query and keep the scope clear
The query and schema are processed locally; the page does not connect to an endpoint, fetch an introspection schema, or run the operation. That keeps the tool useful for offline review, but it also means network permissions, authorization, response data, query cost, and runtime errors are outside its view.
Avoid pasting secrets or confidential business logic into shared browser sessions. For production changes, compare the validated document with the service’s current schema and run the same operation through the application’s normal authenticated test path. A green local check is a syntax and contract signal, not a successful API response.
Frequently asked questions
Can I format a query without a schema?
Yes. The GraphQL parser can format and check document syntax without a schema, but it cannot confirm that fields or arguments exist on the server.
Does validation execute the query?
No. Validation compares the document with the schema locally; it does not call resolvers or return API data.
Where does the schema come from?
Paste the SDL you want to validate against. The page does not fetch introspection data or contact a GraphQL endpoint.
Why might the server still reject a valid document?
The server may use a different schema version, authentication rules, custom directives, query limits, or runtime checks that are not represented in the local SDL.
Privacy note: this tool processes your data in your browser. Your inputs and files are not submitted to NAB Tools.