IQ
PayloadIQ
PayloadIQ Utilities

JSON to GraphQL

Paste a JSON sample and get GraphQL SDL types back — typed fields, nested types, list types and a root Query to start from. It all runs in your browser.

GraphQL types appear here.

Runs in your browser. Your input is not uploaded to PayloadIQ.

JSON to GraphQL turns a JSON sample into a GraphQL SDL schema you can paste into schema.graphql. Each object becomes a type with one typed field per key (Int, Float, String, Boolean, or ID for id-like keys), nested objects get their own types, arrays become list types ([T]!), and a root Query is scaffolded so you have somewhere to start. Everything runs locally in your browser, so a real payload never leaves your machine.

Types now, resolvers next

Fields are non-null (!) because they appear in your sample — loosen them to nullable where your API actually allows it. The generated Query fields are scaffolding: replace them with your real operations and add arguments, enums and mutations. Rename the root type with the Type-name field.

From one payload to a schema

Inference is sample-driven, so paste the richest payload you have — for lists of objects it merges keys across elements so a field present in only some still appears. Prefer types for your client, or a validation schema, from the same payload? Try JSON to TypeScript or JSON to JSON Schema, or open the PayloadIQ playground.

FAQ

Is my JSON uploaded?
No. The JSON is parsed and converted entirely in your browser with JavaScript — it never leaves your device. That makes it safe for real API responses, auth payloads, and anything internal.
What does it generate?
A GraphQL SDL schema: a type per object with one typed field per key (Int, Float, String, Boolean, an ID for id-like keys), nested objects as their own types, arrays as list types ([T]!), plus a root Query type with example getById/list fields to start from.
How are types inferred?
From the sample. Whole numbers become Int and decimals Float; true/false Boolean; strings String (a key named id or *Id becomes ID). Fields are marked non-null (!) because they're present in your sample — relax them to nullable where your API allows it.
Is the output ready to use?
It's a solid starting schema you adapt: review nullability, replace the scaffolded Query resolvers with your real operations, and add arguments, enums and mutations. Inference is sample-driven, so paste the richest representative payload you have.

Related utilities

JSON to TypeScriptJSON to ZodJSON to JSON SchemaJSON Formatter / ValidatorJSON VisualizerJSON MinifierJSON DiffJSON to CSV
Open PayloadIQ Playground