GraphQL to Introspection JSON
Turn a GraphQL schema into an introspection document: one entry per type with its fields and a NON_NULL/LIST/named type reference.
What the GraphQL to Introspection JSON does
Named kinds are resolved from the schema: an object is OBJECT, an input is INPUT_OBJECT, an enum is ENUM and a built-in scalar is SCALAR. A name that is not declared is refused by name, because the document would otherwise be missing a type it references.
Conventional roots are resolved the way GraphQL resolves them: type Query is the query root without a schema block, and an explicit block overrides it.
Descriptions are null: the schema's prose is not modelled here. Directive usages are dropped, because they do not change a type's shape.
How to use it
Paste the schema into the GraphQL schema box, or press Run with the example already there.
Read the Introspection JSON below: the types array holds one entry per declared type, in declaration order.
Check the Introspection JSON queryType entry — it names the type an operation starts from, or is null when the schema declares no query root.
Worked example
Input:
type Query {
ping: String
}
Output:
{
"__schema": {
"queryType": {
"name": "Query"
},
"mutationType": null,
"subscriptionType": null,
"types": [
{
"kind": "OBJECT",
"name": "Query",
"description": null,
"fields": [
{
"name": "ping",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [],
"enumValues": null,
"possibleTypes": null
}
]
}
}
Why it runs in your browser
The result is produced on this page with JavaScript, so it works offline after the page loads and nothing you enter is sent anywhere.
The document a GraphQL server returns from an introspection query, built from your schema: one entry per type, one field per entry, one type reference per field.
The shape is checkable: a non-null field nests a NON_NULL wrapper around its named kind, so a client reading it sees the same graph a live server would report.
What it does, and what it does not
Named kinds are resolved from the schema: an object is OBJECT, an input is INPUT_OBJECT, an enum is ENUM and a built-in scalar is SCALAR. A name that is not declared is refused by name, because the document would otherwise be missing a type it references.
Conventional roots are resolved the way GraphQL resolves them: `type Query` is the query root without a `schema` block, and an explicit block overrides it.
Descriptions are null: the schema's prose is not modelled here. Directive usages are dropped, because they do not change a type's shape.
How to use GraphQL to Introspection JSON
Paste the schema into the GraphQL schema box, or press Run with the example already there.
Read the Introspection JSON below: the `types` array holds one entry per declared type, in declaration order.
Check the Introspection JSON `queryType` entry — it names the type an operation starts from, or is null when the schema declares no query root.
What to Expect
Best for
- Producing a deterministic introspection document for a schema you own
- Inspecting the exact type references a field carries
Not ideal for
- Replacing a live introspection query against a running server
- Copying descriptions, which this page does not model
What this tool keeps
- Every declared type in declaration order
- Type references built from NON_NULL, LIST and the named kind
What may need cleanup
- Descriptions need adding if a client displays them
- Deprecation flags are always false because the schema copy has none
Common errors
- The page refuses it: unknown type Missing referenced by Query.ping
Example use cases
- Diffing two schemas as introspection documents
- Feeding a schema into a tool that expects introspection JSON
Sample input
GraphQL schema: type Query { …
Sample output
Introspection JSON: { …
Who this is for
- Anyone building schema tooling
- Developers checking what a schema tells a client
Frequently asked questions
Is this the same document a server returns?
The shape is the same — types, fields, args and type references — but descriptions and deprecation reasons are null, because the schema text this page reads carries neither.
Why does a non-null field nest a wrapper?
That is how GraphQL models it: NON_NULL is a type whose ofType is the named type. The wrapper is what tells a client the field cannot be null.
What if a field names a type the schema does not declare?
The page refuses and names the type and the field that references it, rather than emitting a document with a dangling reference.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.