npm / @graphql-codegen/typescript
@graphql-codegen/typescript
What changed in @graphql-codegen/typescript 2 to 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-12.
21 breaking9 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@graphql-codegen/typescript 73 changes
Breaking changes 2
GraphQL 14 and 15 are no longer supported; the peer dependency now requires ^16.0.0 or ^17.0.0.
Node.js versions below 22.18.0 are no longer supported; upgrade to 22.18.0 or later.
Fixes and other changes 1
Fixes typesPrefix being applied to enum keys when generating enums as const.
@graphql-codegen/typescript 625 changes
Breaking changes 17
The visitor methods’ path and ancestors parameters are now required, matching the values the visitor always passes and fixing type errors under strict: true.
The default custom scalar type is now unknown instead of any.
The extractAllFieldsToTypes option moved from base-visitor to documents-visitor.
The globalNamespace option moved from base-visitor to documents-visitor.
The ignoreEnumValuesFromSchema option moved from base-visitor to documents-visitor and types-visitor.
The nonOptionalTypename option moved from base-visitor to documents-visitor and types-visitor.
The getRootTypeNames function was removed because it is available in @graphql-utils/tools and was unused.
The unused Incremental utility type was removed from the typescript plugin.
The unused MakeEmpty utility type was removed from the typescript plugin.
The unused MakeMaybe utility type was removed from the typescript plugin.
The unused MakeOptional utility type was removed from the typescript plugin.
Node 20 support is dropped; users are asked to upgrade to Node 22.
The addTypename option moved from base-visitor to types-visitor because it is only a types-visitor concern.
The ignoreEnumValuesFromSchema option moved from base-visitor to documents-visitor and types-visitor.
The skipTypename option moved from base-visitor to types-visitor because it is only a types-visitor concern.
The typescript plugin no longer generates the Exact utility type; typescript-operations generates it for each operation file instead.
The plugin no longer generates InputMaybe and Scalars types; it now uses native TypeScript types instead.
Fixes and other changes 8
The method's emitted type declaration now allows a null return.
The method's emitted type declaration now returns string | null.
The constructor's pluginConfig parameter is typed as TypeScriptPluginConfig | undefined.
Document files without a document are skipped when collecting introspection types.
Types the visitor parameters overridden by TsVisitor and allows EnumTypeDefinition to return null, fixing type errors under strict: true.
The enumPrefix option moved to base-visitor so all three visitor types can keep enum type names in sync.
The enumSuffix option moved to base-visitor so all three visitor types can keep enum type names in sync.
Fixed namingConvention so it is applied consistently, including in imports, Variables, Input, and Result.
@graphql-codegen/typescript 31 changes
Breaking changes 1
Node.js 12 support was dropped, so developers can no longer rely on this package supporting Node.js 12.
@graphql-codegen/typescript 21 changes
Breaking changes 1
Node 10 is no longer supported by graphql-tools or Codegen packages.