GraphQL Validator
Check a GraphQL schema for syntax problems and see a breakdown of types, fields, enums, and directives
Input
Validation
What is the GraphQL Validator?
A schema that comes back from a federation composer, a code generator, or a hand-edit during a code review almost always has at least one syntax problem on the first pass. A stray }, an unterminated description string, an enum body that got chopped off when someone copied half a screen of SDL into a chat — and the next thing you know your Apollo Server startup blows up with a parser error pointing at line 1, which is rarely where the actual problem is. This validator walks the SDL token-by-token and points at the real line.
It checks structural rules from the October 2021 GraphQL spec: every {, (, and [ needs a matching closer of the right kind; descriptions written as """...""" have to be terminated; quoted strings inside arguments must close on the same line. The validator does NOT verify semantics — it will not tell you that Query is missing or that a field references an undeclared type. For that, run the schema through the reference graphql-js implementation. What this page does well is the syntax pass and the stat block, so you can see at a glance whether the schema you just pasted has 14 types or 4, 187 fields or 12.
Everything runs in your browser. No upload, no schema stored anywhere. Paste, validate, copy.
How to Use the GraphQL Validator
Three quick steps. The buttons below match the actual buttons on this page.
Paste, Upload, or Load a Sample
Paste a GraphQL schema into the left Input panel — validation runs automatically a fraction of a second after you stop typing, so there is no Validate button. Click Upload for a .graphql, .graphqls, or .gql file, or hit Sample to load a realistic e-commerce Order schema. A typical paste looks like this:
type Order { id: ID! placedAt: DateTime! customer: Customer! items: [OrderItem!]! status: OrderStatus! } enum OrderStatus { PENDING PAID SHIPPED }Both server-style schemas (with extend type Query) and standalone type files work. Comments (#) and block-string descriptions ("""...""") are handled the same way the GraphQL learn-schema docs describe.
Read the Stat Block
The right panel shows a green banner if the schema parses cleanly, a red banner if it does not — and either way you get a stat breakdown of how many type, interface, enum, input, union, scalar, and directive definitions the schema declares, plus the total field count, argument count, and description count. Useful for sanity-checking a federation merge or comparing two revisions of the same schema. The counts mirror what the Relay GraphQL specification calls out as the structural pieces of a definition.
Fix and Re-paste
If the schema is invalid, the banner tells you the exact line of the unbalanced brace or unterminated string. Fix it, paste it back, watch the banner go green. The Copy button on the right gives you a small JSON stat report you can drop into a PR description or a chat message — handy when you want to show a teammate "yes the schema is fine, here are the stats" without sharing the SDL itself.
When You'd Actually Use This
Pre-merge sanity check
Before merging a federation gateway change or a schema-stitching update, paste the composed schema in. If the brace balance is off or a description is unterminated, you will see it here in two seconds rather than in a CI failure ten minutes later. Pairs well with the rover subgraph check command for the semantic side.
Diffing two revisions
Paste version A, note the stat numbers (28 types, 142 fields, 6 enums). Paste version B, compare. If the field count jumped by 40 but only one new type was added, somebody probably duplicated a fragment. The stat block is much faster than scrolling through a 2000-line diff.
Onboarding a new contractor
Hand them the schema file, point them at this page, and say "if it goes red, your paste is broken; if the field count is suddenly 800 lower, you only copied half of it." Saves the back-and-forth of "is this all of it?" before they even get to writing resolvers.
Pasting from chat
Slack and Discord love to mangle backticks and quote characters when wrapping long messages, so a schema someone pasted into a thread often loses a closing brace or two. Drop it in here first to find out before opening it in your IDE.
Common Questions
Does it validate semantics, or just syntax?
Just syntax — brace balance, string termination, and a stat walk over the token stream. It does NOT check that Query exists, that referenced types are defined, that arguments match their directive definitions, or that a field type is valid. For full semantic validation, use the reference graphql-js library or your server's startup checks.
Is my schema sent to a server?
No. Validation runs entirely in your browser. Nothing is uploaded, nothing is logged. Safe to paste internal or unreleased schemas.
What syntax problems will it actually catch?
Unmatched { / ( / [ with the line number where the opener was, mismatched closers like ) where } was expected, unterminated "strings" or """block strings""", and stray characters that are not part of the GraphQL token grammar.
Why does my schema show 0 types when it clearly has types?
The stat counter only counts a definition once both its keyword (type, interface, etc.) AND its body braces are present. If you pasted a schema that is truncated mid-type, the count for that type stays 0 until you finish the body. The validator banner will also be red in that case, pointing at the unmatched opener.
Does it understand block-string descriptions?
Yes. """An order placed by a customer.""" is recognised as a description token and counted in the Descriptions stat. The validator does not enforce where descriptions appear — that is a style choice — but the count gives you a quick read on how documented the schema is.
How big a schema can I paste?
Anything your browser comfortably renders. Schemas of a few hundred types and several thousand fields validate in well under a second. Past 5 MB the Ace editor itself starts to slow down, which is the bottleneck — not the validator.
Other GraphQL Tools
Validation is one part of working with GraphQL. These tools handle the rest: