Report

Help us improve this tool

GraphQL To TypeScript

Generate TypeScript types and operation types from GraphQL schema and documents with real-time browser-side codegen.

O M T

Generate TypeScript Types from GraphQL

TypeScript projects that talk to GraphQL APIs need typed definitions that mirror the server schema and client operations. Hand-writing these types drifts out of date whenever fields change. This converter generates TypeScript types from GraphQL SDL and operation documents automatically in your browser.

What this tool does

Paste your GraphQL schema and optional query or mutation documents. The tool emits TypeScript definitions including scalars, object types, enums, input types, and operation result types. Edit either input and the output refreshes instantly.

Related tools

Need MongoDB-specific document types? Use the GraphQL to TypeScript MongoDB converter. For React Apollo or urql component codegen, try the GraphQL to Components Generator. To prettify GraphQL before conversion, use the GraphQL Beautifier.

Frequently Asked Questions

What TypeScript output does this generator produce?

The tool uses GraphQL Code Generator with the TypeScript and TypeScript Operations plugins. Output includes schema types, enums, and operation-specific variable and result types when documents are provided.

Can I convert schema only without operations?

Yes. Leave the document field empty to generate schema-level TypeScript types. Add queries or mutations when you need operation-specific variable and result types.

Does this work with multiple operations in one document?

Yes. Include several named operations in the document editor and the generator produces TypeScript types for each operation alongside shared schema types.

How is this different from the MongoDB TypeScript converter?

This tool generates standard TypeScript types for GraphQL schemas and operations. The MongoDB variant adds document mapper types tailored for MongoDB collections and resolver patterns.

Is my GraphQL schema uploaded anywhere?

No. Parsing and codegen run entirely in your browser. Schema and operation text never leave your machine.