GraphQL schema validator and viewer
Runs in your browser. Nothing is uploaded.
Validate a GraphQL schema (SDL) for syntax errors and schema problems, then read it rendered as documentation.
Ctrl/⌘+Enter runs again
Input
"""
A pet store: pets, their owners and the orders that adopt them.
"""
type Query {
pet(id: ID!): Pet
pets(first: Int = 20, after: String): [Pet!]!
owner(id: ID!): Owner
}
type Mutation {
adoptPet(petId: ID!, ownerId: ID!): Order!
}
type Pet {
id: ID!
name: String!
species: Species!
owner: Owner
}
enum Species {
DOG
CAT
BIRD
}
type Owner {
id: ID!
name: String!
pets: [Pet!]!
address: Address
}
type Order {
id: ID!
pet: Pet!
owner: Owner!
placedAt: String!
}
Result
Paste, upload or load a file to start
How it works
Paste, upload or load a GraphQL schema in SDL. The page parses it and builds the schema with the checks of
apigit lint, lists each problem with its line, and renders the schema with APIGit's docs viewer, in a sandboxed
frame below the findings: types, fields, arguments and their descriptions.
The sample is a pet store schema with one fault left in, a field of a type the schema does not define:
0 errors, 1 warning
line 31 warn graphql-schema Unknown type "Address".
The field address: Address on Owner names a type that is not in the file. Define Address, or remove the field,
and the rendered schema appears below the findings.
What it does not do
- It does not run queries: there is no server behind the schema. A mock server does that (see the table).
- It does not read introspection JSON or fetch a schema from a GraphQL endpoint; it takes SDL.
- A schema with problems is not rendered until they are fixed: the viewer needs a schema that builds.
- It does not merge several schema files into one; paste them as one text.
- Nothing is uploaded, and nothing is kept outside this browser.
This tool and APIGit
| This tool | With APIGit |
|---|---|
| One schema, checked and rendered | GraphQL schemas in a Git repository, with Code, Diff, Governance and Preview in the editor |
| Syntax and schema checks by hand | apigit lint schema.graphql in CI (CLI 0.6.0 or later) or the GitHub Action |
| No queries | A hosted mock server that answers queries and mutations from the SDL, or apigit mock serve schema.graphql locally |
| A rendered page in your browser | A published docs site with the schema next to your OpenAPI specs and Markdown guides |
| No agent pages | One generated Markdown page per schema file in a published version's llms.txt and document MCP search |
Questions and answers
What does the GraphQL validator check?
The syntax of the SDL and the schema itself: unknown types, duplicate names and other schema problems, as apigit lint reports them. It uses GraphQL's own checks, not Spectral rule sets.
Why is an unknown type a warning and not an error?
A file may be one part of a larger schema, so a type defined in another file is not necessarily missing. Broken syntax is a graphql-syntax error; schema problems are graphql-schema warnings. With the CLI, --fail-severity warn makes them fail a build too.
Why is my schema not rendered?
The viewer can only draw a schema that builds. While the validator reports problems such as an unknown type, the rendered schema waits; it appears once they are fixed.
Does it accept introspection JSON?
No. Paste SDL, the text of a .graphql or .gql file. APIGit imports SDL too, rather than introspection JSON.
Is my schema uploaded?
No. The checks run in your browser, and the rendered schema is drawn in a sandboxed frame with no access to the page or the network.
Can I get a mock server for this schema?
Yes, with APIGit: apigit mock serve schema.graphql runs one on your machine (CLI 0.7.0 or later), and a hosted mock answers queries and mutations over HTTP from the SDL. Subscriptions are not mocked.
Learn more
- GraphQL "Syntax Error: Expected Name, found ...": causes and fixes in SDL
- GraphQL schema documentation: descriptions, deprecation, and how the reference renders
- Schema-first GraphQL: write the schema, lint it, mock it, call it
- A GraphQL mock server from a schema file, in one command
- GraphQL and OpenAPI together: one repository, linted, mocked and published as one site