
GraphQL SDL: Validate and Format a Schema Online
SDL syntax errors, schema review and formatting before merge — extends the existing GraphQL beautifier.
Validate GraphQL SDL before the merge
A schema that does not parse blocks code generation, stops the GraphQL server from starting, and turns a review into guesswork. The usual culprits (a missing brace, an unknown type name, a forgotten Query root) hide in a 400-line SDL diff. FastMinify's GraphQL SDL validator runs buildSchema from GraphQL.js in your browser. Paste the schema document, and you get a valid or invalid verdict, with line and column when GraphQL.js provides them. Formatting stays on Beautify GraphQL (Prettier), and there is no separate format-graphql slug. Browse the rest of the cluster from the API tools hub. If you also maintain REST contracts, pair this workflow with the OpenAPI validation guide.
Honest limits and habits that survive code review
A valid verdict means buildSchema from GraphQL.js accepted the pasted SDL. It is not a proof that your API behaves correctly in production.
.graphql files, includes, or Git URLsThe browser tool is for a fast loop before git push. Teams still run GraphQL.js, graphql-eslint, or rover in CI as the merge gate.
Query type or a custom schema { query: … }Most SDL incidents are rename leftovers and missing roots, not exotic GraphQL features.
Schema SDL and queries are two documents with two tools
Schema Definition Language (SDL) describes types, fields, and roots. It is the contract your resolvers must meet, not an executable query. FastMinify validates that contract with buildSchema from GraphQL.js, without talking to a live server.
Query, Mutation, and Subscription when those types exist.graphql files from a URLAn operation document (query, mutation, subscription, fragment) is not schema SDL. Pasting one into the validator fails buildSchema. Format those documents on Beautify GraphQL instead.
buildSchema, no query executionGraphQL.js typically requires a Query root type unless your schema definition names another query type. A document with only type User { … } and no query root usually fails validation, which is expected and not a FastMinify bug.
type Query { hello: String }schema { query: RootQuery } plus type RootQuery { … }Validation answers "is this schema SDL accepted by GraphQL.js?". Beautify answers "is this GraphQL readable?". Indentation never fixes an unknown type.
buildSchema and returns valid or invalid, with line and column when availabletabWidth 2 or 4, tabs, and printWidth 80 / 100 / 120Validate first, then format
Open the GraphQL validator, paste a single schema document (max 512 KiB UTF-8), and wait for the verdict, which appears after a short debounce. The results panel shows Valid or Invalid and the first error with line and column when known. It also has a button to copy the error and, when the schema parses, schema statistics.
The GraphQL beautifier pretty-prints schemas and operations with Prettier. Use it for review diffs; it does not replace validation. Options: 2 or 4 spaces or tabs, plus print width. Browse all formatters on the beautify tools hub.
A teammate renamed Pet to Animal but left pet(id: ID!): Pet on Query. CI or the server fails, with little context in the GitHub view.
Paste the schema into validate-graphql
Open validate-graphql. An invalid verdict with Unknown type "Pet" (and a line when available) points at the stale field.
Fix the type name or restore the type
Either rename the field return type to Animal or add type Pet back. Re-paste until the panel shows a valid schema.
Beautify and commit
Run the fixed SDL through beautify-graphql, download or copy it, and update the PR. Reviewers read types, not a one-line blob.
A generated or minified-looking schema lands in the repo. Reviewers cannot see which fields sit on Query and which on Mutation.
Beautify first if you cannot even read it
Paste it into beautify-graphql. Prettier unwraps nested selections and type bodies. This step does not prove the schema is valid.
Validate the formatted document
Copy the pretty SDL into validate-graphql. Confirm the Query root exists and that every named type is defined.
Check the statistics tiles
Type count and root-field counts help you spot an empty Query or a schema that accidentally dropped mutations. Then commit the formatted file.
Conclusion
Validate GraphQL SDL in the browser with buildSchema, then format it with Prettier, all locally and without sending the schema anywhere. That loop catches unknown types and missing Query roots before CI or a gateway. It does not replace a running server, introspection, or federation composition. For REST contracts, stay on the API hub, and for readable queries, stay on Beautify GraphQL.
Validate or format your GraphQL
Related Articles

Paste a token and a JWKS to check an RS256, ES256 or HS256 signature in your browser. How kid picks the key, measured errors and the claims to check.

HTTP/2 and HTTP/3 change how files travel, not how big they are. Measured sizes, compile times and bundling tests show what minification still saves.

Convert a Unix epoch to a readable date and back, tell seconds from milliseconds, and avoid time zone, JWT and clock change traps, all in your browser.