JSON to GraphQL Schema Generator

Generate a GraphQL SDL schema from a sample JSON object

Ad placeholder (leaderboard)

The JSON to GraphQL Schema Generator turns a representative JSON document into a GraphQL Schema Definition Language (SDL) draft. It infers types from your data so you can bootstrap a schema in seconds, then refine the scalar choices by hand. Everything runs in your browser.

How it works

The generator walks the JSON value recursively and builds a type table:

  • Scalarsstring becomes String, boolean becomes Boolean, and a number becomes Int when it is a whole number or Float otherwise.
  • Objects — every nested object becomes its own named type, with the type name derived by PascalCasing the field key (so a address field yields a type Address).
  • Arrays of objects — all elements are merged into one shape. A field is marked non-null (!) only when it appears in every element; fields seen in only some elements stay nullable. This is how genuinely optional fields are detected.
  • Arrays of scalars — become a list of the element scalar, e.g. [String!].

The top-level object becomes the Root type, which is emitted first, followed by every named type it references.

Example

Given an object whose posts array contains items with title and views, plus a pinned flag on only some of them, the tool produces a Post type where title and views are non-null and pinned is nullable — exactly reflecting the optionality observed in the sample.

Notes

Because JSON carries no semantic type beyond its primitive shape, the output is a starting point. Replace inferred String identifiers with ID, ISO date strings with a DateTime scalar, and split large Root objects into proper query and mutation types as your API design requires.

Ad placeholder (rectangle)