GraphQL Validator & Formatter Online

Format GraphQL, validate a query against a schema (SDL or introspection), measure depth and complexity, diff schemas for breaking changes, SDL ↔ JSON.

Free tool: 20 requests per minute.

Result

Press “Run” to see the result.

A toolbox built on graphql-js 17, the reference implementation. action=format pretty-prints a query or SDL document. validate checks a query against a schema (SDL text or an introspection result) and returns every error with line and column, plus the fields used (Type.field coordinates) and which of them are deprecated. Syntax errors always come back with their location. analyze lists operations, variables, fragments, and per operation the depth, field count, alias count and a list-aware complexity score (fields multiplied by first / last / limit arguments); max_depth and max_complexity turn it into a pass / fail check for a gateway.

stats summarises a schema: types by kind, field count, queries, mutations, subscriptions with their arguments, custom directives and deprecated fields. diff compares old_schema with new_schema and sorts changes into breaking (field removed, argument made required…), dangerous (optional argument added, enum value added…) and safe. to-sdl turns an introspection JSON into SDL (sort=true sorts types and fields), to-introspection does the reverse, and sample writes an example query for a Query field or a fragment for a type.

Limits: 2 MB per document, 200,000 tokens. Nothing is executed: the API never sends your query to any server.

Use this in your code

curl -X POST "https://apibox.io.vn/v1/graphql-tools" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"schema":"type Book {\n  id: ID!\n  title: String\n  isbn: String @deprecated(reason: \"use id\")\n}\n\ntype Query {\n  book(id: ID!): Book\n}","query":"{ book(id: 1) { title isbn price } }"}'

API documentation → Get a free API key

FAQ

Does the API run my query?

No. It only parses and validates the document against the schema you provide; no request is sent to your GraphQL server.

How is complexity computed?

Each field selection counts 1, multiplied by the integer value of first, last, limit, take, pageSize or top arguments on its parent fields. Fragments are expanded once and cycles are cut.

Can I give the schema as introspection JSON?

Yes, for every action: pass the JSON result of the introspection query (with __schema, or data.__schema) instead of SDL.