JSON to GraphQL Schema
Generate GraphQL schemas from JSON automatically, in your browser.
What it's for
JSON to GraphQL Schema
Apollo Server compatible
Schema ready to use in Apollo Server, GraphQL Yoga, Pothos, Nexus, or any GraphQL implementation.
100% private
Your API JSON is processed only in your browser. Sensitive data structures never leave your device.
Correct types
Detects String, Int, Float, Boolean, ID. Nested objects generate their own types. Arrays as [Type] lists.
Instant
GraphQL schema ready in milliseconds. No signup, no waiting, no limits.
How it works
Three steps, no hassle
Paste your JSON
Paste any JSON object. The tool analyzes the structure and generates the corresponding GraphQL types.
GraphQL schema generated
You get GraphQL types with all fields correctly typed: String, Int, Float, Boolean, and ID. Nested objects generate their own types.
Copy and use in Apollo Server
Copy the schema and paste it into your GraphQL server (Apollo Server, GraphQL Yoga, Pothos) as a starting point.
FAQ
Got questions?
GraphQL is a query language for APIs developed by Facebook (now Meta) in 2012 for internal use and published as an open-source specification in 2015. It was created to solve REST limitations in mobile applications: over-fetching (receiving more data than needed), under-fetching (needing multiple requests), and the lack of a typed contract. The first implementation was in Facebook's iOS client. Today GraphQL is used by GitHub, Twitter, Shopify, Airbnb, Pinterest, and thousands of companies. The specification is maintained by the GraphQL Foundation (part of the Linux Foundation).
In GraphQL, type defines the structure of data the server can return (in queries and mutations), while input defines the structure of data the client can send (mutation arguments). For example, type User { id: ID!, name: String!, email: String! } defines the returnable User object, while input CreateUserInput { name: String!, email: String! } defines the fields a createUser mutation accepts. Types can have resolvers that dynamically compute fields; inputs are simple data containers. This tool generates types to model existing JSON responses.
GraphQL defines 5 primitive scalar types in the specification: String (UTF-8 text), Int (signed 32-bit integer), Float (double-precision decimal), Boolean (true/false), and ID (unique identifier, represented as String or Int). GraphQL servers can define additional custom scalars: Date, DateTime, URL, Email, JSON, UUID, etc. For example, the graphql-scalars package (for Node.js) offers over 50 custom scalars. This tool uses the 5 standard scalars for maximum compatibility.
In GraphQL, each nested object in the JSON becomes a separate type. If the JSON has {"order": {"product": {"id": 1, "name": "Widget"}}}, it generates: type RootType { order: Order }, type Order { product: Product }, type Product { id: Int, name: String }. This reflects the nature of the GraphQL schema: all types are named and reusable. The same Product type could appear in multiple parent types. Arrays of objects are represented as [Product] (list of Product).
A resolver is a function that knows how to fetch data for a specific schema field. In Apollo Server, each field of each type can have a resolver. If none is defined, Apollo uses the DefaultFieldResolver which simply returns the property with the same name from the parent object. Resolvers allow data to come from multiple sources: database, another API, cache, or real-time calculation. The GraphQL schema (generated by this tool) defines the contract; resolvers implement how to fulfill it.
GraphQL adoption, Apollo Server, schema-first vs code-first, and REST to GraphQL migration
GraphQL was open-sourced by Facebook in July 2015 and quickly generated a vibrant ecosystem. Apollo GraphQL (founded in 2016) created Apollo Server and Apollo Client, becoming the reference implementation. In 2018, GitHub migrated its public API from REST v3 to GraphQL v4, a milestone validating GraphQL for large-scale production APIs. The GraphQL Foundation was formed in 2019 under the Linux Foundation to standardize the specification. In 2024, GraphQL is the second most-used API specification after REST, present in most startups and many Fortune 500 companies.
There are two main approaches for building GraphQL APIs: schema-first and code-first. In schema-first, you define the SDL (Schema Definition Language) schema first and then implement the resolvers. This is the original and most transparent approach: the API contract is visible and editable as text. In code-first, you define the schema through code (TypeScript in the case of Nexus or Pothos): types are defined as JavaScript/TypeScript objects and the SDL schema is generated automatically. Code-first is preferred when seeking end-to-end type-safety with TypeScript. This tool generates SDL (schema-first).
The migration from REST to GraphQL is a gradual process many companies approach with the BFF (Backend For Frontend) pattern: instead of replacing existing REST APIs, a GraphQL layer is added that aggregates multiple REST endpoints. This pattern, popularized by Netflix and Airbnb, allows incremental GraphQL adoption without disrupting existing services. GraphQL Federation (Apollo) goes further: it allows composing multiple GraphQL services into a unified graph, enabling supergraph architectures where each microservice exposes its own subgraph.