JSON to GraphQL SDL
Turn a JSON document into GraphQL types written in Schema Definition Language.
JSON to GraphQL SDL
Paste a JSON object or an array of objects and this tool derives GraphQL types written in Schema Definition Language. It is a fast way to bootstrap a schema from a real API response, a database export or a sample payload, instead of typing every field and type by hand.
Scalars are inferred from the JSON values: strings become String, whole numbers become Int, decimals become Float, and true/false become Boolean. A field named "id" is typed as ID when it holds a string or an integer, matching how most GraphQL APIs identify records. Fields whose sample value is null are marked optional; every other field gets the required marker ("!"). Nested objects become their own named types, referenced from the parent, and structurally identical nested objects are merged into a single type instead of being duplicated. Arrays become list types with the element type inferred from their contents.
Two more options shape the output: turning on the custom-scalar option recognizes ISO date and date-time strings and declares "scalar Date" or "scalar DateTime" instead of treating them as plain String, and the "Generate as" choice switches between a "type" (for queries) and an "input" (for mutation arguments). Enabling "Include Query type" adds a small Query type with one field returning the root type, so the schema is ready to paste into a server or a schema-first tool as-is.
Everything runs locally in your browser — the JSON you paste is never uploaded anywhere. Copy the generated SDL, download it as a .txt file, or send it straight into another tool's input to keep working on it.