DevBolt
Processed in your browser. Your data never leaves your device.

GraphQL Type Generator from JSON

Paste JSON data and get properly structured GraphQL type definitions with inferred scalars, custom scalar declarations, and nested type extraction. Download the schema as a .graphql file.

← Back to tools

JSON to GraphQL Schema Generator

Generate GraphQL schema definitions from JSON data. Automatically infers types, detects IDs, dates, and nested objects. Optionally generates Query and Mutation types.

About JSON to GraphQL Schema

  • Infers GraphQL scalar types (String, Int, Float, Boolean, ID) from JSON values automatically.
  • Detects UUIDs and ID-like fields → ID, dates → DateTime /Date custom scalars.
  • Nested objects become separate GraphQL types. Arrays of objects are merged for complete field coverage.
  • Optionally generates Query type (get by ID, list all) and Mutation type (create, update, delete) with input types.
  • Download the schema as a .graphql file ready for your server.
  • Everything runs in your browser — no data is sent over the network.

GraphQL scalar types

GraphQL has five built-in scalar types: String, Int, Float, Boolean, and ID. The ID type represents a unique identifier and is serialized as a string. For dates and timestamps, GraphQL uses custom scalars like DateTime and Date that must be declared in your schema and implemented in your server's resolver layer.

Non-null types and lists

In GraphQL, types are nullable by default. Adding ! makes a field non-null (e.g., name: String!). List types use brackets (e.g., tags: [String!]!). This tool can automatically add non-null markers to fields that have values in every JSON record, helping you build a stricter, more reliable schema.

Frequently Asked Questions

What is the difference between type and input in GraphQL?

A 'type' defines the shape of data returned by queries. An 'input' defines the shape of data sent to mutations. They look similar but serve different purposes — inputs cannot have fields that return other types, only scalars and other inputs.

How do I add custom scalars like DateTime?

This tool automatically detects ISO date strings in your JSON and declares custom DateTime and Date scalars in the schema output. On your server, you'll need to provide resolver implementations for these scalars using libraries like graphql-scalars.

Related Generate Tools