github dotansimha/graphql-code-generator release-1777556900878
April 30, 2026

4 hours ago

@graphql-codegen/cli@7.0.0

Major Changes

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
    only support ESM

    Node 20 support is dropped in this release. Node 22 comes with require() support for ESM, which
    means it's easier to integrate ES modules into applications. Therefore, it is safe to start using
    ESM-only packages.

    If you are a user, please upgrade to Node 22. If you are a lib maintainer and see ESM vs CJS
    issues when running Jest tests, try using Vitest.

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Drop Node 20 support

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Set noSilentErrors: true
    by default

    When multiple files match documents pattern, and there are syntax errors in some but not others,
    then the operations with errors are not included in the loaded documents list by default
    (noSilentErrors: false). This is annoying for users as there is no feedback loop during
    development.

    noSilentErrors: true is used as the default for Codegen users to make the feedback loop faster.
    It can still overriden in Codegen Config if desired.

Patch Changes

@graphql-codegen/core@6.0.0

Major Changes

Patch Changes

@graphql-codegen/add@7.0.0

Major Changes

Patch Changes

@graphql-codegen/fragment-matcher@7.0.0

Major Changes

Patch Changes

@graphql-codegen/introspection@6.0.0

Major Changes

Patch Changes

@graphql-codegen/schema-ast@6.0.0

Major Changes

Patch Changes

@graphql-codegen/time@7.0.0

Major Changes

Patch Changes

@graphql-codegen/visitor-plugin-common@7.0.0

Major Changes

  • #10496
    afaace6
    Thanks @eddeee888! - Fix nullable field optionality in operations

    Previously, a nullable Result field is generated as optional (marked by ? TypeScript modifier)
    by default. This is not correct, because generally at runtime such field can only be null, and
    not undefined (both missing from the object OR undefined). The only exceptions are when fields
    are deferred (using @defer directive) or marked as conditional (using @skip or @include).

    Now, a nullable Result field cannot be optional unless the exceptions are met. This also limits
    avoidOptionals to only target Variables input, since some users may want to force explicit
    null when providing operation variables.

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: visitors' config option are
    moved based on their use case

    • addTypename/skipTypename: is only a types-visitor concern. This is moved to types-visitor from
      base-visitor
    • nonOptionalTypename: is a documents-visitor and types-visitor concern. Moved from base-visitor
      there
    • extractAllFieldsToTypes: is a documents-visitor concern. Moved from base-visitor there
    • enumPrefix and enumSuffix: need to be in base-visitor as all 3 types of visitors need this to
      correctly sync the enum type names. This is moved to base visitor
    • ignoreEnumValuesFromSchema: is a documents-visitor and types-visitor concern. Moved from
      base-visitor there.
    • globalNamespace: is a documents-visitor concern. Moved from base-visitor there

    Refactors

    • documents-visitor no longer extends types-visitor option types as they have two distinct
      usages now. The types now extend base-visitor types. This is now consistent with
      documents-visitor extending base-visitor
    • Classes now handle config parsing and types at the same level e.g. if typescript-operations
      plugin parses configOne, then the types for configOne must be in that class, rather than in
      base-documents-visitor

    Note: These visitors are rolled up into one type for simplicity

    • base-visitor: includes base-visitor
    • documents-visitor: includes base-documents-visitor and typescript-operations visitor
    • types-visitor: includes base-types-visitor and typescript visitor
    • resolvers-visitor: includes base-resolvers-visitor and typescript-resolvers visitor
  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: make unknown instead of
    any the default custom scalar type

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
    only support ESM

    Node 20 support is dropped in this release. Node 22 comes with require() support for ESM, which
    means it's easier to integrate ES modules into applications. Therefore, it is safe to start using
    ESM-only packages.

    If you are a user, please upgrade to Node 22. If you are a lib maintainer and see ESM vs CJS
    issues when running Jest tests, try using Vitest.

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Drop Node 20 support

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE:
    @graphql-codegen/visitor-plugin-common's base-types-visitor no longer has getNodeComment or
    buildEnumValuesBlock method.

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Operation plugin and Client
    Preset no longer generates optional __typename for result type

    __typenam should not be in the request unless:

    • explicitly requested by the user
    • automatically injected into the request by clients, such as Apollo Clients.

    Note: Apollo Client users can still use nonOptionalTypename: true and
    skipTypeNameForRoot: true to ensure generated types match the runtime behaviour.

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Remove unused utility types
    from typescript plugin as they were previously used for typescript-operations plugin:

    • MakeOptional
    • MakeMaybe
    • MakeEmpty
    • Incremental

    BREAKING CHANGE: Remove getRootTypeNames function because it's available in
    @graphql-utils/tools and not used anywhere

Minor Changes

  • #10496
    afaace6
    Thanks @eddeee888! - Add support for declarationKind for
    typescript-operations

    • Input: can only be type or interface
    • Variables: no support. It must always be type because it's an alias e.g.
      Variables = Exact<{ something: type }>
    • Result: can only be type or interface
      • Note: when extractAllFieldsToTypes:true or extractAllFieldsToTypesCompact:true, Results
        are used as type alias, so they are forced to be type. There is a console warning for users.
  • #10496
    afaace6
    Thanks @eddeee888! - Add importSchemaTypesFrom support

  • #10496
    afaace6
    Thanks @eddeee888! - Adding config option
    extractAllFieldsToTypesCompact, which renders nested types names with field names only (without
    types)

  • #10496
    afaace6
    Thanks @eddeee888! - Add generateOperationTypes to
    typescript-operations to allow omitting operation types such as Variables,
    Query/Mutation/Subscription selection set, and Fragment types

  • #10496
    afaace6
    Thanks @eddeee888! - Fixing 2 bugs: 1) including enums from
    external fragments; 2) extractAllFieldsToTypesCompact does not create duplicates

Patch Changes

@graphql-codegen/typescript-document-nodes@6.0.0

Major Changes

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
    only support ESM

    Node 20 support is dropped in this release. Node 22 comes with require() support for ESM, which
    means it's easier to integrate ES modules into applications. Therefore, it is safe to start using
    ESM-only packages.

    If you are a user, please upgrade to Node 22. If you are a lib maintainer and see ESM vs CJS
    issues when running Jest tests, try using Vitest.

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Drop Node 20 support

Patch Changes

@graphql-codegen/gql-tag-operations@6.0.0

Major Changes

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
    only support ESM

    Node 20 support is dropped in this release. Node 22 comes with require() support for ESM, which
    means it's easier to integrate ES modules into applications. Therefore, it is safe to start using
    ESM-only packages.

    If you are a user, please upgrade to Node 22. If you are a lib maintainer and see ESM vs CJS
    issues when running Jest tests, try using Vitest.

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Drop Node 20 support

Patch Changes

@graphql-codegen/typescript-operations@6.0.0

Major Changes

  • #10496
    afaace6
    Thanks @eddeee888! - Fix nullable field optionality in operations

    Previously, a nullable Result field is generated as optional (marked by ? TypeScript modifier)
    by default. This is not correct, because generally at runtime such field can only be null, and
    not undefined (both missing from the object OR undefined). The only exceptions are when fields
    are deferred (using @defer directive) or marked as conditional (using @skip or @include).

    Now, a nullable Result field cannot be optional unless the exceptions are met. This also limits
    avoidOptionals to only target Variables input, since some users may want to force explicit
    null when providing operation variables.

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: visitors' config option are
    moved based on their use case

    • addTypename/skipTypename: is only a types-visitor concern. This is moved to types-visitor from
      base-visitor
    • nonOptionalTypename: is a documents-visitor and types-visitor concern. Moved from base-visitor
      there
    • extractAllFieldsToTypes: is a documents-visitor concern. Moved from base-visitor there
    • enumPrefix and enumSuffix: need to be in base-visitor as all 3 types of visitors need this to
      correctly sync the enum type names. This is moved to base visitor
    • ignoreEnumValuesFromSchema: is a documents-visitor and types-visitor concern. Moved from
      base-visitor there.
    • globalNamespace: is a documents-visitor concern. Moved from base-visitor there

    Refactors

    • documents-visitor no longer extends types-visitor option types as they have two distinct
      usages now. The types now extend base-visitor types. This is now consistent with
      documents-visitor extending base-visitor
    • Classes now handle config parsing and types at the same level e.g. if typescript-operations
      plugin parses configOne, then the types for configOne must be in that class, rather than in
      base-documents-visitor

    Note: These visitors are rolled up into one type for simplicity

    • base-visitor: includes base-visitor
    • documents-visitor: includes base-documents-visitor and typescript-operations visitor
    • types-visitor: includes base-types-visitor and typescript visitor
    • resolvers-visitor: includes base-resolvers-visitor and typescript-resolvers visitor
  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: typescript-operations plugin
    now generates enum if it is used in operation.

  • #10496
    afaace6
    Thanks @eddeee888! - Conditionally generate input types and output
    enums into target file

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: make unknown instead of
    any the default custom scalar type

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
    only support ESM

    Node 20 support is dropped in this release. Node 22 comes with require() support for ESM, which
    means it's easier to integrate ES modules into applications. Therefore, it is safe to start using
    ESM-only packages.

    If you are a user, please upgrade to Node 22. If you are a lib maintainer and see ESM vs CJS
    issues when running Jest tests, try using Vitest.

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Drop Node 20 support

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Decouple
    typescript-operations plugin from typescript plugin

    Previously, TypeScriptOperationVariablesToObject from typescript-operations was extending from
    typescript plugin. This made it (1) very hard to read, as we need to jump from base class <->
    typescript class <-> typescript-operations class to understand the flow and (2) very hard to
    evolve the two independently (which is the point of this work).

    Since there's not much shared logic anyways, it's simpler to extend the typescript-operations
    class from the base class directly.

  • #10496
    afaace6
    Thanks @eddeee888! - The typescript-operations plugin no longer
    generates InputMaybe and Scalars types; it now uses native Typescript types instead.

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: typescript plugin no
    longer generates Exact utility type. Instead, typescript-operations generates said utility
    type for every file it creates. This is because it is used only for Variables, so we only need
    to generate it once for every generated operation file.

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Operation plugin and Client
    Preset no longer generates optional __typename for result type

    __typenam should not be in the request unless:

    • explicitly requested by the user
    • automatically injected into the request by clients, such as Apollo Clients.

    Note: Apollo Client users can still use nonOptionalTypename: true and
    skipTypeNameForRoot: true to ensure generated types match the runtime behaviour.

  • #10496
    afaace6
    Thanks @eddeee888! - Integrate new typescript-operations into
    client-preset

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: config.avoidOptionals now
    only supports object, inputValue, defaultValue

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: rename avoidOptionals.object
    to avoidOptionals.variableValue

Minor Changes

  • #10496
    afaace6
    Thanks @eddeee888! - Add support for declarationKind for
    typescript-operations

    • Input: can only be type or interface
    • Variables: no support. It must always be type because it's an alias e.g.
      Variables = Exact<{ something: type }>
    • Result: can only be type or interface
      • Note: when extractAllFieldsToTypes:true or extractAllFieldsToTypesCompact:true, Results
        are used as type alias, so they are forced to be type. There is a console warning for users.
  • #10496
    afaace6
    Thanks @eddeee888! - Add importSchemaTypesFrom support

  • #10496
    afaace6
    Thanks @eddeee888! - Add generateOperationTypes to
    typescript-operations to allow omitting operation types such as Variables,
    Query/Mutation/Subscription selection set, and Fragment types

  • #10496
    afaace6
    Thanks @eddeee888! - Fixing 2 bugs: 1) including enums from
    external fragments; 2) extractAllFieldsToTypesCompact does not create duplicates

Patch Changes

@graphql-codegen/typescript-resolvers@6.0.0

Major Changes

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: visitors' config option are
    moved based on their use case

    • addTypename/skipTypename: is only a types-visitor concern. This is moved to types-visitor from
      base-visitor
    • nonOptionalTypename: is a documents-visitor and types-visitor concern. Moved from base-visitor
      there
    • extractAllFieldsToTypes: is a documents-visitor concern. Moved from base-visitor there
    • enumPrefix and enumSuffix: need to be in base-visitor as all 3 types of visitors need this to
      correctly sync the enum type names. This is moved to base visitor
    • ignoreEnumValuesFromSchema: is a documents-visitor and types-visitor concern. Moved from
      base-visitor there.
    • globalNamespace: is a documents-visitor concern. Moved from base-visitor there

    Refactors

    • documents-visitor no longer extends types-visitor option types as they have two distinct
      usages now. The types now extend base-visitor types. This is now consistent with
      documents-visitor extending base-visitor
    • Classes now handle config parsing and types at the same level e.g. if typescript-operations
      plugin parses configOne, then the types for configOne must be in that class, rather than in
      base-documents-visitor

    Note: These visitors are rolled up into one type for simplicity

    • base-visitor: includes base-visitor
    • documents-visitor: includes base-documents-visitor and typescript-operations visitor
    • types-visitor: includes base-types-visitor and typescript visitor
    • resolvers-visitor: includes base-resolvers-visitor and typescript-resolvers visitor
  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: make unknown instead of
    any the default custom scalar type

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
    only support ESM

    Node 20 support is dropped in this release. Node 22 comes with require() support for ESM, which
    means it's easier to integrate ES modules into applications. Therefore, it is safe to start using
    ESM-only packages.

    If you are a user, please upgrade to Node 22. If you are a lib maintainer and see ESM vs CJS
    issues when running Jest tests, try using Vitest.

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Drop Node 20 support

Patch Changes

@graphql-codegen/typed-document-node@7.0.0

Major Changes

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
    only support ESM

    Node 20 support is dropped in this release. Node 22 comes with require() support for ESM, which
    means it's easier to integrate ES modules into applications. Therefore, it is safe to start using
    ESM-only packages.

    If you are a user, please upgrade to Node 22. If you are a lib maintainer and see ESM vs CJS
    issues when running Jest tests, try using Vitest.

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Drop Node 20 support

Patch Changes

@graphql-codegen/typescript@6.0.0

Major Changes

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: visitors' config option are
    moved based on their use case

    • addTypename/skipTypename: is only a types-visitor concern. This is moved to types-visitor from
      base-visitor
    • nonOptionalTypename: is a documents-visitor and types-visitor concern. Moved from base-visitor
      there
    • extractAllFieldsToTypes: is a documents-visitor concern. Moved from base-visitor there
    • enumPrefix and enumSuffix: need to be in base-visitor as all 3 types of visitors need this to
      correctly sync the enum type names. This is moved to base visitor
    • ignoreEnumValuesFromSchema: is a documents-visitor and types-visitor concern. Moved from
      base-visitor there.
    • globalNamespace: is a documents-visitor concern. Moved from base-visitor there

    Refactors

    • documents-visitor no longer extends types-visitor option types as they have two distinct
      usages now. The types now extend base-visitor types. This is now consistent with
      documents-visitor extending base-visitor
    • Classes now handle config parsing and types at the same level e.g. if typescript-operations
      plugin parses configOne, then the types for configOne must be in that class, rather than in
      base-documents-visitor

    Note: These visitors are rolled up into one type for simplicity

    • base-visitor: includes base-visitor
    • documents-visitor: includes base-documents-visitor and typescript-operations visitor
    • types-visitor: includes base-types-visitor and typescript visitor
    • resolvers-visitor: includes base-resolvers-visitor and typescript-resolvers visitor
  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: make unknown instead of
    any the default custom scalar type

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
    only support ESM

    Node 20 support is dropped in this release. Node 22 comes with require() support for ESM, which
    means it's easier to integrate ES modules into applications. Therefore, it is safe to start using
    ESM-only packages.

    If you are a user, please upgrade to Node 22. If you are a lib maintainer and see ESM vs CJS
    issues when running Jest tests, try using Vitest.

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Drop Node 20 support

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: typescript plugin no
    longer generates Exact utility type. Instead, typescript-operations generates said utility
    type for every file it creates. This is because it is used only for Variables, so we only need
    to generate it once for every generated operation file.

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Remove unused utility types
    from typescript plugin as they were previously used for typescript-operations plugin:

    • MakeOptional
    • MakeMaybe
    • MakeEmpty
    • Incremental

    BREAKING CHANGE: Remove getRootTypeNames function because it's available in
    @graphql-utils/tools and not used anywhere

Minor Changes

  • #10496
    afaace6
    Thanks @eddeee888! - The typescript-operations plugin no longer
    generates InputMaybe and Scalars types; it now uses native Typescript types instead.

Patch Changes

@graphql-codegen/client-preset@6.0.0

Major Changes

  • #10496
    afaace6
    Thanks @eddeee888! - Fix nullable field optionality in operations

    Previously, a nullable Result field is generated as optional (marked by ? TypeScript modifier)
    by default. This is not correct, because generally at runtime such field can only be null, and
    not undefined (both missing from the object OR undefined). The only exceptions are when fields
    are deferred (using @defer directive) or marked as conditional (using @skip or @include).

    Now, a nullable Result field cannot be optional unless the exceptions are met. This also limits
    avoidOptionals to only target Variables input, since some users may want to force explicit
    null when providing operation variables.

  • #10496
    afaace6
    Thanks @eddeee888! - Conditionally generate input types and output
    enums into target file

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: make unknown instead of
    any the default custom scalar type

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
    only support ESM

    Node 20 support is dropped in this release. Node 22 comes with require() support for ESM, which
    means it's easier to integrate ES modules into applications. Therefore, it is safe to start using
    ESM-only packages.

    If you are a user, please upgrade to Node 22. If you are a lib maintainer and see ESM vs CJS
    issues when running Jest tests, try using Vitest.

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Drop Node 20 support

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: typescript plugin no
    longer generates Exact utility type. Instead, typescript-operations generates said utility
    type for every file it creates. This is because it is used only for Variables, so we only need
    to generate it once for every generated operation file.

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Operation plugin and Client
    Preset no longer generates optional __typename for result type

    __typenam should not be in the request unless:

    • explicitly requested by the user
    • automatically injected into the request by clients, such as Apollo Clients.

    Note: Apollo Client users can still use nonOptionalTypename: true and
    skipTypeNameForRoot: true to ensure generated types match the runtime behaviour.

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGES: The default hashing
    algorithm is now sha256 instead of sha1. Generated sha256 format also follows the standard
    outlined in
    https://github.com/graphql/graphql-over-http/blob/52d56fb36d51c17e08a920510a23bdc2f6a720be/spec/Appendix%20A%20--%20Persisted%20Documents.md#sha256-hex-document-identifier

  • #10496
    afaace6
    Thanks @eddeee888! - Integrate new typescript-operations into
    client-preset

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: config.avoidOptionals now
    only supports object, inputValue, defaultValue

Patch Changes

@graphql-codegen/graphql-modules-preset@6.0.0

Major Changes

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
    only support ESM

    Node 20 support is dropped in this release. Node 22 comes with require() support for ESM, which
    means it's easier to integrate ES modules into applications. Therefore, it is safe to start using
    ESM-only packages.

    If you are a user, please upgrade to Node 22. If you are a lib maintainer and see ESM vs CJS
    issues when running Jest tests, try using Vitest.

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Drop Node 20 support

Patch Changes

@graphql-codegen/testing@5.0.0

Major Changes

Patch Changes

@graphql-codegen/plugin-helpers@7.0.0

Major Changes

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
    only support ESM

    Node 20 support is dropped in this release. Node 22 comes with require() support for ESM, which
    means it's easier to integrate ES modules into applications. Therefore, it is safe to start using
    ESM-only packages.

    If you are a user, please upgrade to Node 22. If you are a lib maintainer and see ESM vs CJS
    issues when running Jest tests, try using Vitest.

  • #10496
    afaace6
    Thanks @eddeee888! - BREAKING CHANGE: Drop Node 20 support

Patch Changes

Don't miss a new graphql-code-generator release

NewReleases is sending notifications on new releases.