Generate TypeScript types from GraphQL SDL schema definitions.
Free online GraphQL to TypeScript converter. Paste a GraphQL SDL schema and instantly generate TypeScript interfaces for all object types, input types, and interfaces. Converts unions to TypeScript union types, enums to union literals, enum keyword, or const objects. Handles nullable fields, ReadonlyArray, and custom scalar type mappings. Runs entirely in your browser — no data is ever sent to a server.
Keywords: graphql to typescript, graphql schema to typescript, graphql to types, graphql to interfaces, graphql sdl to typescript, graphql type generator, graphql typescript converter, convert graphql to typescript, graphql to ts online, graphql schema types generator, graphql typescript types
Tags: graphql, typescript, schema, types, converter, sdl
Paste your GraphQL Schema Definition Language (SDL) into the input panel on the left.
Choose your preferred enum style: union literal types, TypeScript enum keyword, or const object.
Toggle options such as readonly properties, optional fields for nullable types, and custom scalar mappings.
Click "Generate" or press ⌘↵ to produce the TypeScript type definitions.
Copy the output with ⌘⇧C and paste it into your TypeScript project or .d.ts declaration file.
Parses complete GraphQL SDL including object types, input types, enums, unions, interfaces, and scalars
Generates TypeScript interfaces for GraphQL object and input types with accurate nullable/required mapping
Three enum output styles: TypeScript union literal types, enum keyword, or const object with as const assertion
Handles nullable fields (Type vs Type | null | undefined) following GraphQL's explicit nullability model
Generates union types for GraphQL union types using TypeScript discriminated union patterns
Interface types in GraphQL map to TypeScript interfaces that are then extended by implementing types
Optional readonly modifier on all generated properties for immutable type patterns
Custom scalar type mapping — configure ID, Date, DateTime, JSON to your preferred TypeScript types
GraphQL ID scalar maps to string by default (consistent with Apollo and urql clients)
Runs entirely in your browser — your schema is never uploaded to any server
Keyboard shortcut ⌘↵ to generate, ⌘⇧C to copy TypeScript output