JSON → GraphQL SDL
ClientPaste JSON to emit type blocks with camelCase fields—nested objects become linked types; numbers map to Float. This is a starting point, not a full schema linter.
Learn more: GraphQL SDL drafts
Emit `type` definitions with camelCase fields inferred from JSON keys—numbers map to Float; nested objects become separate types. This is a sketch, not a validated GraphQL schema.
Nullability
The generator marks many fields as non-null (`!`) when they appear in the sample. Real APIs often need nullable fields, interfaces, and custom scalars—edit before publishing.
Compared to OpenAPI
OpenAPI describes HTTP operations and JSON Schema; GraphQL SDL describes graph types and fields. Use both tools when you are bridging REST samples to a GraphQL model.
JSON → GraphQL SDL
?
Infers type blocks from object keys and nested objects. Arrays use the first element only; numbers map to Float. This is a starting point—not a full GraphQL schema linter.
Add scalars, interfaces, and federation directives in your repo; adjust ! nullability to match your API contract.
Common use cases
- Sketch GraphQL types from a REST JSON sample before wiring resolvers and DataLoaders.
- Compare inferred shapes with JSON → OpenAPI when you are straddling REST and GraphQL.
- Document example payloads as SDL snippets in design docs.
Common mistakes to avoid
Publishing SDL without nullability review
Samples often look non-null; real APIs need nullable fields, interfaces, and custom scalars.
Ignoring list inference limits
Empty arrays and heterogeneous lists are ambiguous—adjust element types before codegen.
FAQ
Is SDL generation local?
Yes. Output is produced entirely in your browser.
Does this validate against a GraphQL server?
No—it is a text draft. Run your usual schema lint or federation checks in CI.
More tools
Related utilities you can open in another tab—mostly client-side.
JSON → OpenAPI draft
ClientTurn sample JSON into a minimal OpenAPI 3 paths entry with an inferred schema—YAML or JSON output.
JSON Schema validate
ClientValidate JSON against a schema, infer draft-07 schema from data—Ajv in browser.
JSON → Protocol Buffers (proto3)
ClientDraft proto3 messages from sample JSON—repeated fields, nested messages, client-side.
JSON Pointer & Patch
ClientRFC 6901 pointers, apply RFC 6902 patches, generate diff patches—client-side.