GraphQL to TypeScript
Generate readable TypeScript interfaces, enums, unions, and scalar types from GraphQL SDL. · Updated
graphql
Formatted Outputtypescript
Draft saved locally.
FAQ
What does this GraphQL generator support?
It generates interfaces, enums, unions, input types, and scalar aliases from GraphQL SDL.
Are nullable fields optional in TypeScript?
Yes. Fields without GraphQL's non-null marker are emitted as optional properties.
Are GraphQL built-in scalars mapped?
ID and String map to string, Int and Float map to number, and Boolean maps to boolean.
Does the schema leave my browser?
No. Parsing and generation run entirely in your browser.
Can I generate types from queries?
This tool generates types from SDL schema definitions; use the schema as the source of truth for reusable API types.
Related tools
GraphQL Formatter & Minifier
Format, beautify, validate AST, and minify GraphQL queries, mutations, subscriptions, and SDL schemas.
JSON to TypeScript
Generate strongly typed TypeScript interfaces and type aliases from sample JSON documents instantly.
TypeScript to JSON Schema Converter
Convert TypeScript interfaces and type definitions directly to valid Draft-07 JSON Schema specifications.
OpenAPI Formatter & Validator
Validate OpenAPI 3 and Swagger 2 documents, then format them as readable JSON or YAML.
GraphQL to cURL
Turn a GraphQL operation (plus optional variables) into a ready-to-run curl command — entirely in-browser.