JSON to GraphQL Schema Converter
Paste a JSON sample to instantly generate matching GraphQL SDL type definitions, with nested types, list types, and non-null fields inferred automatically. Free online developer tool.
Paste JSON
GraphQL SDL
GraphQL type definitions will appear here...
Free JSON to GraphQL Schema Converter
Paste a JSON sample to instantly generate matching GraphQL SDL type definitions. Nested objects become their own named types, arrays become list types, and fields that are present and non-nullable in every sample get GraphQL's ! non-null suffix automatically.
How to Use It
Paste any JSON object into the input box, or click "Load Example" to see a sample run. The converter parses your JSON, infers a GraphQL scalar or object type for every field, and generates one SDL type per object level — nested objects are pulled out into their own type named after the parent property.
Example
Given {"name": "Ann", "age": 30, "tags": ["a","b"], "address": {"city": "NYC", "zip": null}}, the tool generates a RootAddress type for the nested object plus a Roottype referencing it, with name: String!, age: Int!,tags: [String!]!, and zip: String (no !, since it was observed as null).
Common Use Cases
- Bootstrapping a GraphQL schema for a new API from an existing REST response.
- Scaffolding SDL types for a GraphQL gateway wrapping an existing JSON-based service.
- Checking at a glance which fields should be non-null in a GraphQL schema design.
- Speeding up schema-first GraphQL development by starting from real sample data.
FAQs
When does a field get the ! non-null suffix?
A field gets GraphQL's ! suffix only when it is both never missing (not optional) and never observed as null (not nullable) across your sample. If either condition fails, the field is left nullable, matching GraphQL's stricter definition of non-null.
What type is used for fields with unknown or mixed types?
Since GraphQL has no built-in "any" scalar, fields with an unrecognized or mixed type map to a custom JSON scalar, and a scalar JSON declaration is added at the top of the output automatically whenever it's needed.
Is my JSON uploaded anywhere?
No — parsing and schema generation happen entirely client-side in your browser. Nothing you paste is sent to a server.
