JSON to GraphQL Schema
NewGenerate GraphQL type definitions from a JSON object's structure.
JSON to GraphQL
Generate a GraphQL schema from JSON
Paste a JSON object (or array of objects) and get GraphQL type definitions inferred from its shape — nested objects become their own types, arrays become list types, and a top-level Query type is included.
Frequently Asked Questions
How are nested objects turned into separate types?
Every nested object gets its own named type (derived from its key, PascalCased), rather than being inlined, matching how GraphQL schemas are normally structured.
What GraphQL scalar does a JSON number become?
Whole numbers become Int and any number with a decimal point becomes Float — this is checked per value, not per field, using JavaScript's Number.isInteger.
What if I paste a JSON array instead of an object?
The tool reads the first item in the array as the representative shape for that type, since a GraphQL type is a single shape, not a per-item union.
Does it generate a Query type, or only the data types?
Both — alongside every inferred type, it adds a Query type with an items list field and a single item(id: ID!) field as a reasonable default entry point, which you can edit further.
What does an empty array or an array of nulls become?
With no usable sample value to infer a shape from, it falls back to a plain [String] list type — replace it manually once you know the real element type.