Starting a GraphQL API from an existing JSON response — say, from a REST endpoint you’re migrating — usually means manually writing out type definitions field by field. Inferring them directly from a sample payload is faster and less error-prone.
What Is JSON to GraphQL Schema?
JSON to GraphQL Schema is one of the tools in WebdevToolbox’s JSON Tools category. Paste a JSON object (or an array of objects) and get GraphQL type definitions inferred from its shape, including nested objects as their own types, arrays as list types, and a starter Query type.
How to Use It
- Open the tool at /tools/json-to-graphql.
- Paste a JSON object, or an array where the first item represents the shape.
- Copy the generated GraphQL schema — types are named after the object’s key, PascalCased.
- Refine field types manually where the sample JSON was ambiguous (e.g. an empty array, or a value that’s always
nullin your sample).
Key Features
- Nested objects become separate types — matching how real GraphQL schemas are structured, rather than inlining everything.
- Automatic scalar inference — whole numbers become
Int, decimals becomeFloat, booleans becomeBoolean. - Starter Query type included — a reasonable
items/item(id: ID!)entry point is generated alongside your data types. - 100% private — inference runs entirely in your browser.
When to Use JSON to GraphQL Schema
- Bootstrapping a new GraphQL API from an existing REST response shape.
- Documenting an API’s data shape quickly in GraphQL SDL syntax.
- Learning GraphQL type syntax by seeing it generated from JSON you already have.
Try It Now
Open JSON to GraphQL Schema directly from anywhere on the site using ⌘K and typing the tool name.
Part of the JSON Tools collection on WebdevToolbox — free, browser-based developer tools with no login required.