JSON to GraphQL Schema — Free Online
JSON to GraphQL schema generator — produces SDL types from any JSON sample. One type per shape, required fields by default, Apollo and Yoga ready.
PDFFlare's JSON to GraphQL schema generator emits an SDL schema from any JSON sample — one typeper unique object shape, required fields by default, inferred scalar types (Int, Float, String, Boolean). A starting schema you refine into your domain's production SDL.
Need a Protobuf schema instead? JSON to Protobuf. TypeScript types? JSON to TypeScript.
How to Generate GraphQL Schema from JSON
Paste a JSON sample
An API response or document representing the shape you want as a GraphQL type.
Click Convert to GraphQL
PDFFlare emits one type per unique object shape with required fields and inferred scalar types — drop straight into a GraphQL SDL file.
Refine and ship
Mark optional fields, add field arguments, declare unions or interfaces — the generated types are a starting point that gets you out of the blank-page state.
When Do You Need JSON to GraphQL?
Wrapping a REST API in GraphQL: The upstream returns JSON; your gateway exposes GraphQL. Generate the SDL from real responses, refine, then write resolvers that fetch from the underlying API.
Schema-first prototyping: Sketch a payload as JSON, paste it here, get a starting SDL file. Faster than writing the schema by hand when you're still iterating on shape.
Federated subgraphs: Bootstrap a subgraph schema from sample data; refine with @key, @external, and @requires directives once the core types land.
Documentation and onboarding: Show new engineers what a payload looks like in their familiar GraphQL syntax — easier to read than a JSON Schema or a TS interface for many GraphQL-first teams.
Why Choose PDFFlare's JSON to GraphQL Schema Generator?
Standard GraphQL SDL
Output is plain SDL — works with Apollo, GraphQL Yoga, gqlgen, Hot Chocolate, or any GraphQL server.
One Type Per Shape
Each unique object shape becomes its own type — no nesting confusion, easy to refactor.
100% Browser-Based
JSON samples stay on your device — safe for production payloads.
No Signup Required
No account, no rate limits.
Frequently Asked Questions About JSON to GraphQL
PDFFlare's JSON To Graphql tool runs entirely in your browser. Standard GraphQL Schema Definition Language: type definitions with fields, scalar types (Int, Float, String, Boolean, ID), and required markers (!). One type per unique object shape, named after the property name (singularized for arrays of objects).
Strings → String, integers → Int, decimals → Float, booleans → Boolean. JSON nulls fall back to nullable String. Refine to ID, custom scalars (DateTime, JSON), or enums manually based on your domain.
Non-null by default — every field gets a trailing ! since the inference can't know which fields are optional in the API contract from one sample. Refine manually: drop the ! for fields the API may omit, especially in input types.
Each unique object shape becomes its own type. Names are inferred from property names (singularized for arrays of objects), giving you defaults like User, Post, Comment that you can rename to fit your domain.
Single-sample inference can't detect them — they require either schema annotations or multiple samples. Refine the output manually: turn a status field into an enum, lift common fields into an interface, model polymorphic data as a union.
No — this generates the schema (SDL) only. Resolvers map types to data sources and depend on your server framework (Apollo, Yoga, gqlgen). Once the schema lands, your codegen tool of choice (graphql-code-generator, gqlgen, etc.) can stub resolvers from the SDL.
No. The conversion runs entirely in your browser — safe for production payloads.
Both produce schemas, but for different ecosystems. Protobuf targets gRPC and binary wire-format with field numbers; GraphQL targets HTTP query APIs with SDL types and fragment-based clients. Use Protobuf when you control both ends and need binary speed; use GraphQL when clients want flexible queries.