Ready to generate
Paste JSON and click Generate// turn json objects into graphql type definitions
Convert JSON objects into GraphQL type definitions instantly. Auto-detects scalar types (String, Int, Float, Boolean, ID) and generates clean, ready-to-use GraphQL schema types.
Ready to generate
Paste JSON and click GenerateEnter any valid JSON object or array into the input field on the left.
Enter a meaningful name for your root GraphQL type (e.g. User, Product).
Click Generate and copy the ready-to-use GraphQL type definitions.
This tool parses your JSON structure and generates valid GraphQL SDL (Schema Definition Language) type definitions. It automatically maps JSON value types to GraphQL scalars: numbers become Int or Float, booleans become Boolean, UUID-like strings become ID, and everything else becomes String. Nested objects produce additional named types.
The tool maps JSON types to GraphQL scalars: true/false → Boolean, integer numbers → Int, decimal numbers → Float, UUID-formatted strings → ID, and all other strings → String. Null values default to String.
Nested JSON objects generate separate named GraphQL types. The sub-type name is created by combining the parent type name with the field name in PascalCase. For example, a address field inside User generates a UserAddress type.
When enabled, all fields are marked as non-null with the ! suffix (e.g. name: String!). This matches the common convention of defining schema fields as required by default and handling nullability explicitly. Toggle it off to leave fields nullable.
Yes. The generated output is standard GraphQL SDL compatible with any GraphQL server: Apollo Server, GraphQL Yoga, Hasura remote schemas, Pothos, Nexus, and more. You may need to add resolvers or adjust field names to match your data source.
Array fields are wrapped in GraphQL list notation: [String], [Int], etc. Arrays of objects generate a sub-type and produce [SubType] fields. Only the first element of each array is used to infer the item type.
The conversion is performed server-side via a lightweight PHP API on the same domain. No data is stored, logged, or shared. For sensitive payloads, you can anonymize values before pasting — only the JSON structure and types matter for schema generation.
Manually writing GraphQL type definitions from a JSON payload is tedious and error-prone. This free tool automates the process: paste any JSON object, click generate, and get clean GraphQL SDL type definitions ready to drop into your schema file.
💡 Looking for premium JavaScript plugins and scripts? MonsterONE offers unlimited downloads of templates, UI kits, and developer assets — worth checking out.
GraphQL SDL (Schema Definition Language) is the human-readable syntax used to define types, queries, mutations, and subscriptions in a GraphQL API. A type definition describes the shape of data: its fields and their types. For example:
type User {
id: ID!
name: String!
age: Int!
email: String!
}
Every field has a name and a type. The exclamation mark (!) means the field is non-null — it will always have a value. SDL is used by tools like Apollo Server, GraphQL Yoga, Hasura, Nexus, and Pothos to build type-safe APIs.
GraphQL has five built-in scalar types, and JSON value types map to them naturally:
"hello")42)3.14)true, false)"550e8400-e29b-41d4-a716-446655440000"This tool performs that mapping automatically. Rather than reading every field and guessing the type, the tool inspects the actual value in your sample JSON and assigns the most precise GraphQL scalar.
Real-world APIs rarely return flat objects. Nested structures are common — a User might have an address object, a list of roles, or embedded metadata. This tool handles all of these:
address inside type User generates a UserAddress type with its own fields.[String], an array of numbers becomes [Int] or [Float].[SubType].[String] by default since no type information is available.In GraphQL, fields are nullable by default — they can return null. Adding ! makes a field non-null. Most schema designs use non-null as the default and add nullability only where needed. The "Required (!)" toggle in this tool lets you choose your preferred convention. Enable it to generate field: Type! everywhere; disable it for the nullable default field: Type.
Teams migrating from REST to GraphQL often have existing API responses documented or captured in Postman or Insomnia. Instead of manually transcribing every field into SDL, you can paste the response JSON here and get a complete starting schema in seconds. It's a practical way to bootstrap a GraphQL API layer over an existing data source.
GraphQL convention is to use PascalCase for type names (UserProfile, not user_profile). This tool automatically converts the type name you provide and any derived sub-type names into PascalCase. Field names retain their original casing but special characters are replaced with underscores to keep them valid GraphQL identifiers.
ID scalar instead of String.[String] to the correct type afterward.DateTime or JSON manually after generation for fields that hold timestamps or unstructured data.