This is a @graphql-codegen plugin (v2.0.2, active development) that generates only the TypeScript types (inputs, enums, objects) actually used in your GraphQL operations. It acts as a drop-in replacement for the official @graphql-codegen/typescript plugin but reduces output size by excluding unused types. It is designed to work alongside @graphql-codegen/typescript-operations with preResolveTypes: true. Requires Node >=16 and graphql@0.12-16. Ship TypeScript definitions.
npm install graphql-codegen-typescript-operation-typesNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Generates minimal TypeScript types for used GraphQL operations, combining operation types plugin.
Remove @graphql-codegen/typescript from plugins list.
Set config.omitObjectTypes: true if you only want enums and inputs.
Use unscoped name in plugins list.
Ensure only one version of graphql is installed (npm dedupe).
Check schema path and ensure schema is valid.
npm install --save-dev graphql-codegen-typescript-operation-types
No dependency data recorded yet.