Generator Knowledge Base

JSON to GraphQL: Generate Type Definitions & Schema Boilerplate

Generate GraphQL SDL type definitions from any JSON. Produces type, input, Query, and Mutation boilerplate with correct scalars. Free, browser-only.

From JSON to GraphQL API in Seconds

Building a GraphQL API from an existing REST API or database? The hardest part is writing all the type definitions. Paste a sample JSON response and get a complete SDL schema including types, input types, and Query/Mutation boilerplate.

GraphQL Scalar Mapping

  • stringString
  • integer → Int
  • float → Float
  • booleanBoolean
  • Field named id or _idID
  • null → nullable (no ! modifier)

What Gets Generated

  • type TypeName { ... } — Query return type
  • input TypeNameInput { ... } — Mutation argument type
  • type Query { get, list } — Sample query resolvers
  • type Mutation { create, update, delete } — Sample mutations

Try Our Free Client-Side Developer Tools

Zero latency, 100% data privacy, and Web Worker performance.

Launch Tool

Frequently Asked Questions

What is a GraphQL input type?

An input type is used as an argument in mutations. Unlike regular types, input types can be passed as arguments and are typically used for create/update operations.

Does the generator support nested objects?

Yes. Nested JSON objects generate separate type and input blocks, referenced by the parent type.

Can I disable the Query and Mutation boilerplate?

Yes. Uncheck "Generate Query boilerplate" in the toolbar to output only the type definitions.

Related JSON Topics & Reference Articles