{"id":47830,"library":"graphql-codegen-typescript-operation-types","title":"graphql-codegen-typescript-operation-types","description":"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.","status":"active","version":"2.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/Stonepaw/graphql-codegen-typescript-operation-types","tags":["javascript","graphql","codegen","graphql-codegen","gql","typescript"],"install":[{"cmd":"npm install graphql-codegen-typescript-operation-types","lang":"bash","label":"npm"},{"cmd":"yarn add graphql-codegen-typescript-operation-types","lang":"bash","label":"yarn"},{"cmd":"pnpm add graphql-codegen-typescript-operation-types","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Do not use both; this plugin replaces @graphql-codegen/typescript.","wrong":"plugins:\n  - @graphql-codegen/typescript","symbol":"typescript plugin","correct":"// In graphql-codegen config YAML:\nplugins:\n  - graphql-codegen-typescript-operation-types"}],"quickstart":{"code":"// codegen.yml\noverwrite: true\nschema: 'schema.graphql'\ndocuments: 'operations/**/*.graphql'\ngenerates:\n  generated-types.ts:\n    plugins:\n      - graphql-codegen-typescript-operation-types\n      - typescript-operations\n    config:\n      omitObjectTypes: true\n      preResolveTypes: true\n\n// Then run: graphql-codegen","lang":"typescript","description":"Generates minimal TypeScript types for used GraphQL operations, combining operation types plugin."},"warnings":[{"fix":"Remove @graphql-codegen/typescript from plugins list.","message":"plugin replaces @graphql-codegen/typescript; using both will cause conflicts","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Set config.omitObjectTypes: true if you only want enums and inputs.","message":"omitObjectTypes: true required for minimal output; otherwise generates all object types","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use unscoped name in plugins list.","message":"old plugin name 'graphql-codegen-typescript-operation-types' is correct; do not use scoped @graphql-codegen/ prefix","severity":"deprecated","affected_versions":"<2.0"}],"env_vars":null,"search_vec":"'-16':75 '/typescript':46 '/typescript-operations':65 '0.12':74 '16':71 'act':33 'activ':15 'actual':26 'alongsid':61 'codegen':3,12,45,64,81,84 'definit':78 'design':58 'develop':16 'drop':37 'drop-in':36 'enum':24 'exclud':53 'generat':18 'gql':85 'graphql':2,11,30,44,63,73,80,83 'graphql-codegen':10,43,62,82 'graphql-codegen-typescript-operation-typ':1 'input':23 'javascript':79 'node':70 'object':25 'offici':42 'oper':5,31 'output':50 'plugin':13,47 'preresolvetyp':67 'reduc':49 'replac':39 'requir':69 'ship':76 'size':51 'true':68 'type':6,22,55 'typescript':4,21,77,86 'unus':54 'use':27 'v2.0.2':14 'work':60","created_at":"2026-06-07T16:53:31.749920+00:00","updated_at":"2026-06-07T16:53:31.749920+00:00","problems":[{"fix":"Ensure only one version of graphql is installed (npm dedupe).","cause":"Multiple instances of graphql package installed","error":"Cannot use GraphQLSchema \"[object Object]\" from another module or realm."},{"fix":"Check schema path and ensure schema is valid.","cause":"Missing or invalid schema file path in codegen.yml","error":"TypeError: Cannot read properties of undefined (reading 'getType')"},{"fix":"npm install --save-dev graphql-codegen-typescript-operation-types","cause":"Plugin not installed or not added to devDependencies","error":"Plugin graphql-codegen-typescript-operation-types not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/Stonepaw/graphql-codegen-typescript-operation-types#readme","github":"https://github.com/Stonepaw/graphql-codegen-typescript-operation-types","docs":null,"changelog":null,"pypi":null,"npm":"graphql-codegen-typescript-operation-types","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}