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.

Nearby workflows on Toolcore

  • JSON formatterwhen the sample still needs strict parse before you trust the inference.
  • JSON → AsyncAPIwhen the payload might be an event rather than REST.
  • Compare JSONafter you change the sample and want to see structural drift.

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. Validate with your own schema and federation tools before you rely on the output.

Common search terms

Phrases people search for that match this tool. See the full long-tail keyword index.

  • json to graphql sdl
  • generate graphql schema from json

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