JSON → GraphQL SDL

Client

Paste 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.

Related utilities you can open in another tab—mostly client-side.