ToolZoneX
Blog

GraphQL Schema to AST Converter

Paste a GraphQL SDL schema to parse it into an abstract syntax tree and see a clean, readable JSON view of every type definition. Free online developer tool.

Paste GraphQL Schema (SDL)
Simplified AST (JSON)
AST output will appear here...

Free GraphQL Schema to AST Converter

Paste a GraphQL SDL schema to parse it into an abstract syntax tree and see a clean, readable JSON view of every type definition — its kind, name, and fields — without the location and token noise of a raw parser AST.

How to Use It

Paste your GraphQL schema definition language (SDL) into the input box, or click "Load Example" to see a sample run. The tool parses your SDL into a document of definitions, then walks each definition — object types, interfaces, input types, enums, unions, and scalars — into a simplified JSON structure showing its kind, name, and field or value names and types.

Example

A type User implements Node { id: ID! name: String! } definition becomes a JSON entry with kind: "ObjectTypeDefinition", name: "User", an interfaces array listing Node, and a fields array listing each field name paired with its GraphQL type string (ID!, String!).

Common Use Cases

  • Understanding how a parser sees your schema without wading through raw location metadata.
  • Debugging why a schema fails to parse by inspecting the definitions that did parse.
  • Feeding a simplified structure into a custom codegen or documentation script.
  • Learning the shape of GraphQL's type system definitions while studying the spec.

FAQs

Why isn't this the full raw AST from the parser?

The raw AST that GraphQL.js produces includes a loc object with source line/column offsets on every single node, which adds a lot of noise without adding insight for most use cases. This tool strips that out and keeps only the parts you usually care about: type kind, name, and field/value structure.

Does this validate my schema, or just parse it?

Only parsing — syntactic validity is checked, but semantic rules (like whether an interface's fields are actually implemented) are not. Use the GraphQL to Introspection JSON tool if you need a fully built and validated schema.

Is my schema uploaded anywhere?

No — parsing happens entirely client-side in your browser. Nothing you paste is sent to a server.