Convert JSON to GraphQL
Schema, queries
and mutations.
Generate a complete GraphQL schema from any JSON sample. Types, Input types, Query and Mutation — all inferred from your data. Runs entirely in your browser.
!),
non-null values get the non-null modifier.
How JSON values map to GraphQL scalar and composite types.
| JSON value | GraphQL type | With null |
|---|---|---|
"Alice" | String! | String |
42 | Int! | Int |
98.5 | Float! | Float |
true | Boolean! | Boolean |
null | String | — |
["a", "b"] | [String]! | [String] |
[{…}, {…}] | [ChildType]! | [ChildType] |
{…} | ChildType! | ChildType |
When starting a new GraphQL API, generate the schema from a sample API response or database record. The generated types, queries and mutations give you a working schema to build resolvers against — no manual type definition boilerplate.
When wrapping a REST API with a GraphQL layer, paste the REST response JSON to generate the corresponding GraphQL types. The Query type shows how to expose list and single-item endpoints, and the Mutation type covers write operations.
Export a row from your database as JSON and generate the GraphQL type. Nested relations (foreign keys loaded as objects) become separate GraphQL types automatically — mirroring the structure you'd define manually in a GraphQL-first schema.
Generate GraphQL types from mock data JSON to set up Apollo Server mocking, MSW (Mock Service Worker) or graphql-tools schema stitching without writing type definitions from scratch.
GraphQL schema generated
in your browser. No server.
The generator traverses the JSON tree recursively, building GraphQL type definitions for every nested object. Type names are derived from the JSON key using PascalCase conversion. Non-null modifiers (!) are added automatically for any field with a non-null value in the sample.
The Input type mirrors the main type but removes all ! modifiers — making all fields optional for partial update mutations, following the standard GraphQL pattern.
