GraphQL document validator
Check a whole GraphQL document against local SDL or introspection JSON and download complete static diagnostics with exact originals.
- 1Add input
- 2Adjust settings
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Check every operation and fragment against a schema you already have. Review source locations and retain both originals with the full validation report.
How to use this tool
- Paste the whole GraphQL operation document in the first box.
- Choose the schema format and paste local SDL or introspection JSON, or select one schema file.
- Run the static check and inspect schemaValid, documentValid and every diagnostic location.
- Download both exact originals and validation-report.json; then test execution in the intended API environment.
Supported inputs and limits
Paste a whole operation document up to 1 MiB and a schema up to 2 MiB as UTF-8. Or select one schema file up to 2 MiB: it replaces only the schema box; your operation document stays in place. Choose SDL or introspection explicitly. Original filename labels allow 512 UTF-8 bytes.
Only standard static rules from GraphQL.js 17.0.2 run. All operations and fragments are checked together; no operationName selection, React/JavaScript extraction, endpoint request, custom validation rule, resolver or scalar coercion. A passing result does not establish that a query can execute or a response is valid.
Schema syntax/type errors and operation syntax/semantic errors produce complete diagnostic reports. Schema errors leave documentValid null. Locations use one-based lines and UTF-16 columns; CRLF is one line break. Structural introspection errors without original-source coordinates have no invented location.
Use fatal UTF-8 decoding and paired Unicode scalar values. One leading BOM is accepted and retained in original bytes and SHA256. Introspection JSON must be strict: decoded duplicate keys, ambiguous __schema plus data.__schema, or an errors member produce schema diagnostics. Escaped unpaired surrogates are refused atomically.
Introspection metadata numbers must be finite IEEE 754 values; integer-valued numbers must lie within ±9,007,199,254,740,991. No overwritten duplicate array names in types, fields, arguments, enum values or directives. Extra envelope metadata is ignored semantically and its keys are listed; originals remain exact.
SDL allows 100,000 syntax tokens and 100,000 AST nodes; the operation document allows 50,000 of each. Both allow 64 nested braces, brackets or parentheses; acyclic fragment chains allow 64 definitions. Tokens exclude comments, commas and whitespace. AST counts include Document and Name nodes, excluding location links.
Introspection JSON allows 128 object/array levels and 100,000 tree nodes, including property and key nodes. Reachable non-__ schema types allow 2,000 including injected scalars. Embedded introspection default values share the schema token/AST budgets and 64-level limit; they are parsed as GraphQL const values.
Allow at most 1,000 complete diagnostics and a 1 MiB UTF-8 report. If another diagnostic or byte would exceed these limits, no partial report is published. The two separate originals allow up to 3 MiB together. A disposable Worker has an automatic 10-second deadline; cancellation, timeout, capacity or encoding refusal returns no output.
The screen previews 4,000 Unicode codepoints of the report. Copy and downloads retain the complete report. GraphQL Float literal 1e400 and arbitrary custom-scalar literals can pass standard static rules; this tool performs no runtime numeric or custom-scalar coercion. Inputs stay in this browser.
Worked example
Example input
query Find{x}Example options
schemaFormat=sdl; schema: type Query{x:Int}Example output
schemaValid=true; documentValid=true; diagnostics=0; executed=false
When something does not work
Correct the indicated schema or document. For capacity or timeout refusal, reduce the document or schema and rerun. Cancellation retains the same inputs; rerunning creates a fresh Worker and publishes only a complete report.
Frequently asked questions
Does a valid result mean my mutation will work?
It means the whole document passed the pinned standard static rules against this local schema. Authentication, resolver behavior, variable values, custom scalars, server extensions and response validity require separate checks in the intended API environment.
Why does documentValid become null?
The schema itself failed syntax, structure or type validation, so semantic checking against it did not run. Download the full schema diagnostic report, fix the schema, then check the document again.
What does a schema file replace?
Only the secondary schema text. The first operation document remains required, and the explicit format choice controls parsing regardless of the filename or MIME type.
Documentation & further reading
Related tools
JSON formatting workspace
Format or minify strict JSON, sort object keys, and encode or decode strings while preserving raw number tokens.
Regex tester
Try a pattern and see what it matches in your text.
Compare text
See what changed, side by side.
HTML formatter
Format HTML indentation so its structure is easier to read.