github dotansimha/graphql-code-generator release-1791212016765
October 05, 2026

4 hours ago

@graphql-codegen/cli@7.4.4

Patch Changes

  • #11025
    43d0f65
    Thanks @BuddhaBing! - Widen
    Types.SchemaWithLoaderOptions['loader'] to accept a custom loader function
    (CustomSchemaLoaderFn) in addition to a path string.

    A per-entry schema custom loader ({ '<pointer>': { loader, ...options } }) is resolved by
    @graphql-tools/load's useCustomLoader, which already accepts either a path string (resolved
    via require()) or a function value at runtime (typeof loaderPointer === 'function'). Only the
    TypeScript type restricted loader to string, forcing consumers who pass an imported loader
    function (or a class instance exposing a bound loader property) to cast the schema array to
    bypass the type error, even though it worked correctly at runtime.

    This is additive and backward compatible — loader: string continues to type-check exactly as
    before.

    Also fixes a schema-cache collision for function loaders in @graphql-codegen/cli: the cache key
    is JSON.stringify(schemaPointerMap), and JSON.stringify drops functions, so two generates
    targets using different loader functions for the same pointer
    ({ 'schema.graphql': { loader: fnA } } vs { loader: fnB }) both keyed as
    {"schema.graphql":{}} and the second silently reused the first's schema. Function values are now
    keyed by object identity (via the existing getJsObjectId), so distinct loaders load separately
    while one function reused across targets still loads once.

  • #11020
    82ebbb5
    Thanks @eddeee888! - Fix type errors in cli under
    strict: true:

    • @graphql-codegen/cli: loadCodegenConfig returns Promise<LoadCodegenConfigResult | null>,
      matching the null it resolves to when no config file is found. YamlCliFlags includes the
      kebab-case ignore-no-documents, emit-legacy-common-js-imports and import-extension flags
      that the CLI reads. CodegenContext.filepath is optional, and watch mode only watches the
      config file when the context has a filepath. CodegenContext.getConfig() without an argument
      returns Types.Config, and getConfig(extraConfig) returns T & Types.Config.
      CodegenContext.checkModeStaleFiles is typed as string[]. Adds @types/yargs,
      @types/babel__generator and @types/babel__template as dev dependencies.
    • @graphql-codegen/plugin-helpers: normalizeInstanceOrArray and normalizeConfig accept
      null and undefined, returning [].

    Generated output is unchanged.

  • Updated dependencies
    [43d0f65,
    82ebbb5,
    e972b6d,
    eae0e62,
    1f7566f]:

    • @graphql-codegen/plugin-helpers@7.4.1
    • @graphql-codegen/client-preset@6.2.1

@graphql-codegen/time@7.1.1

Patch Changes

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

Patch Changes

  • #11009
    1f7566f
    Thanks @eddeee888! - Fix type errors in typescript-operations
    under strict: true by widening the shared types it calls into:

    • @graphql-codegen/plugin-helpers: Types.ComplexPluginOutput's prepend and append now
      accept null items. Core already skipped them.
    • @graphql-codegen/visitor-plugin-common: DeclarationBlock.withComment accepts undefined,
      parseEnumValues's mapOrStr is optional (it already defaulted to {}),
      ImportSource.namespace accepts null, and optimizeOperations's includeFragments is
      optional.
    • @graphql-codegen/typescript-operations: skips document files without a document, and no
      longer throws when called without the plugin info argument.

    Generated output is unchanged.

  • #11014
    7a376ef
    Thanks @eddeee888! - Fix type errors in typescript under
    strict: true by typing the shared visitor methods it overrides:

    • @graphql-codegen/visitor-plugin-common: adds NormalizedDeclarationKindConfig (every
      declaration kind set), used by normalizeDeclarationKind, DEFAULT_DECLARATION_KINDS and
      ParsedTypesConfig.declarationKind. BaseTypesVisitor's NamedType, ListType,
      FieldDefinition, InputValueDefinition and UnionTypeDefinition have typed visitor params
      (key and parent are required, since the visitor always passes them), and
      ObjectTypeDefinition, EnumTypeDefinition and DirectiveDefinition may return null.
    • @graphql-codegen/typescript: skips document files without a document when collecting
      introspection types, types the TsVisitor visitor params, and TsVisitor.EnumTypeDefinition
      may return null like the introspection visitor's override.

    Generated output is unchanged.

  • #11031
    3caccd3
    Thanks @eddeee888! - Fix type errors in visitor-plugin-common
    (selection-set-to-object, client-side-base-visitor and base-documents-visitor) under
    strict: true:

    • BaseDocumentsVisitor._selectionSetToObject is optional, since it is only set by
      setSelectionSetHandler. FragmentDefinition and OperationDefinition throw a descriptive
      error when it is not set, and FragmentDefinition throws one when the fragment's type condition
      is not in the schema.
    • BaseDocumentsVisitor.FragmentDefinition may return null, which it already returns when
      generateOperationTypes is false.
    • ClientSideBaseVisitor.buildOperation may return null, which its base implementation already
      returns.
    • SelectionSetToObject.transformSelectionSet declares its return type, and throws a descriptive
      error when the instance has no selection set.
    • LinkField's alias is optional, matching the link fields built for fields without an alias.
    • BaseSelectionSetProcessor.typeCache is keyed by Location | undefined, since selection sets
      parsed with noLocation have no loc.
    • getPossibleTypes accepts any GraphQLType or undefined, which it already handles by
      unwrapping lists and non-nulls and returning no types, and returns a copy of the schema's
      possible types instead of the schema's own readonly array.
    • OperationVariablesToObject.transform accepts undefined, which it already handles by
      returning null.

    Generated output is unchanged.

  • #11030
    ccc0d5c
    Thanks @eddeee888! - Fix type errors in visitor-plugin-common
    (base-resolvers-visitor) under strict: true:

    • BaseResolversVisitor's constructor takes additionalConfig as Partial<TPluginConfig>, since
      the visitor fills in the defaults for every key it leaves out.
    • BaseResolversVisitor's ScalarTypeDefinition, DirectiveDefinition and EnumTypeDefinition
      may return null, which they already return for skipped federation scalars and directives and
      for enums without mappers or enumValues.
    • BaseResolversVisitor.getAbstractMembersType's isTypenameNonOptional is optional, matching
      the optional resolversNonOptionalTypename flags it is read from.
    • BaseResolversVisitor.defaultMapperType throws a descriptive error when the defaultMapper
      config is not set.

    Generated output is unchanged.

  • Updated dependencies
    [43d0f65,
    82ebbb5,
    eae0e62,
    1f7566f]:

    • @graphql-codegen/plugin-helpers@7.4.1

@graphql-codegen/typescript-operations@6.1.10

Patch Changes

  • #11019
    eae0e62
    Thanks @eddeee888! - Fix type errors in plugin-helpers under
    strict: true:

    • @graphql-codegen/plugin-helpers: ProfilerEvent.cat is optional, matching the Trace Event
      format and Profiler.run's optional cat. FederationMeta's reference selection sets are
      typed recursively ({ [field: string]: true | ReferenceSelectionSet }), matching the nested
      selections @key/@requires/@provides produce. oldVisit's visitor param is typed as
      OldVisitor: enter and leave maps keyed by AST node kind, whose callbacks receive the typed
      node plus graphql's key, parent, path and ancestors. Federation directives missing their
      fields argument, and operations whose root type is missing from the schema, throw a
      descriptive error.
    • @graphql-codegen/typescript and @graphql-codegen/typescript-operations: the
      InputValueDefinition visitor methods take path and ancestors as required params, since the
      visitor always passes them.

    Generated output is unchanged.

  • #11009
    1f7566f
    Thanks @eddeee888! - Fix type errors in typescript-operations
    under strict: true by widening the shared types it calls into:

    • @graphql-codegen/plugin-helpers: Types.ComplexPluginOutput's prepend and append now
      accept null items. Core already skipped them.
    • @graphql-codegen/visitor-plugin-common: DeclarationBlock.withComment accepts undefined,
      parseEnumValues's mapOrStr is optional (it already defaulted to {}),
      ImportSource.namespace accepts null, and optimizeOperations's includeFragments is
      optional.
    • @graphql-codegen/typescript-operations: skips document files without a document, and no
      longer throws when called without the plugin info argument.

    Generated output is unchanged.

  • Updated dependencies
    [43d0f65,
    82ebbb5,
    eae0e62,
    1f7566f,
    7a376ef,
    3caccd3,
    ccc0d5c]:

    • @graphql-codegen/plugin-helpers@7.4.1
    • @graphql-codegen/visitor-plugin-common@7.2.8

@graphql-codegen/typescript@6.1.1

Patch Changes

  • #11019
    eae0e62
    Thanks @eddeee888! - Fix type errors in plugin-helpers under
    strict: true:

    • @graphql-codegen/plugin-helpers: ProfilerEvent.cat is optional, matching the Trace Event
      format and Profiler.run's optional cat. FederationMeta's reference selection sets are
      typed recursively ({ [field: string]: true | ReferenceSelectionSet }), matching the nested
      selections @key/@requires/@provides produce. oldVisit's visitor param is typed as
      OldVisitor: enter and leave maps keyed by AST node kind, whose callbacks receive the typed
      node plus graphql's key, parent, path and ancestors. Federation directives missing their
      fields argument, and operations whose root type is missing from the schema, throw a
      descriptive error.
    • @graphql-codegen/typescript and @graphql-codegen/typescript-operations: the
      InputValueDefinition visitor methods take path and ancestors as required params, since the
      visitor always passes them.

    Generated output is unchanged.

  • #11014
    7a376ef
    Thanks @eddeee888! - Fix type errors in typescript under
    strict: true by typing the shared visitor methods it overrides:

    • @graphql-codegen/visitor-plugin-common: adds NormalizedDeclarationKindConfig (every
      declaration kind set), used by normalizeDeclarationKind, DEFAULT_DECLARATION_KINDS and
      ParsedTypesConfig.declarationKind. BaseTypesVisitor's NamedType, ListType,
      FieldDefinition, InputValueDefinition and UnionTypeDefinition have typed visitor params
      (key and parent are required, since the visitor always passes them), and
      ObjectTypeDefinition, EnumTypeDefinition and DirectiveDefinition may return null.
    • @graphql-codegen/typescript: skips document files without a document when collecting
      introspection types, types the TsVisitor visitor params, and TsVisitor.EnumTypeDefinition
      may return null like the introspection visitor's override.

    Generated output is unchanged.

  • Updated dependencies
    [43d0f65,
    82ebbb5,
    eae0e62,
    1f7566f,
    7a376ef,
    3caccd3,
    ccc0d5c]:

    • @graphql-codegen/plugin-helpers@7.4.1
    • @graphql-codegen/visitor-plugin-common@7.2.8

@graphql-codegen/client-preset@6.2.1

Patch Changes

  • #10995
    e972b6d
    Thanks @eddeee888! - Fix type errors under strict: true. The
    preset now throws a clear error when schemaAst is missing from the preset options, and the babel
    plugin throws when a file has no filename. Both cases used to crash later with a less clear error.
    Generated output is unchanged.

  • Updated dependencies
    [43d0f65,
    82ebbb5,
    eae0e62,
    1f7566f,
    7a376ef,
    3caccd3,
    ccc0d5c]:

    • @graphql-codegen/plugin-helpers@7.4.1
    • @graphql-codegen/typescript@6.1.1
    • @graphql-codegen/typescript-operations@6.1.10
    • @graphql-codegen/visitor-plugin-common@7.2.8

@graphql-codegen/plugin-helpers@7.4.1

Patch Changes

  • #11025
    43d0f65
    Thanks @BuddhaBing! - Widen
    Types.SchemaWithLoaderOptions['loader'] to accept a custom loader function
    (CustomSchemaLoaderFn) in addition to a path string.

    A per-entry schema custom loader ({ '<pointer>': { loader, ...options } }) is resolved by
    @graphql-tools/load's useCustomLoader, which already accepts either a path string (resolved
    via require()) or a function value at runtime (typeof loaderPointer === 'function'). Only the
    TypeScript type restricted loader to string, forcing consumers who pass an imported loader
    function (or a class instance exposing a bound loader property) to cast the schema array to
    bypass the type error, even though it worked correctly at runtime.

    This is additive and backward compatible — loader: string continues to type-check exactly as
    before.

    Also fixes a schema-cache collision for function loaders in @graphql-codegen/cli: the cache key
    is JSON.stringify(schemaPointerMap), and JSON.stringify drops functions, so two generates
    targets using different loader functions for the same pointer
    ({ 'schema.graphql': { loader: fnA } } vs { loader: fnB }) both keyed as
    {"schema.graphql":{}} and the second silently reused the first's schema. Function values are now
    keyed by object identity (via the existing getJsObjectId), so distinct loaders load separately
    while one function reused across targets still loads once.

  • #11020
    82ebbb5
    Thanks @eddeee888! - Fix type errors in cli under
    strict: true:

    • @graphql-codegen/cli: loadCodegenConfig returns Promise<LoadCodegenConfigResult | null>,
      matching the null it resolves to when no config file is found. YamlCliFlags includes the
      kebab-case ignore-no-documents, emit-legacy-common-js-imports and import-extension flags
      that the CLI reads. CodegenContext.filepath is optional, and watch mode only watches the
      config file when the context has a filepath. CodegenContext.getConfig() without an argument
      returns Types.Config, and getConfig(extraConfig) returns T & Types.Config.
      CodegenContext.checkModeStaleFiles is typed as string[]. Adds @types/yargs,
      @types/babel__generator and @types/babel__template as dev dependencies.
    • @graphql-codegen/plugin-helpers: normalizeInstanceOrArray and normalizeConfig accept
      null and undefined, returning [].

    Generated output is unchanged.

  • #11019
    eae0e62
    Thanks @eddeee888! - Fix type errors in plugin-helpers under
    strict: true:

    • @graphql-codegen/plugin-helpers: ProfilerEvent.cat is optional, matching the Trace Event
      format and Profiler.run's optional cat. FederationMeta's reference selection sets are
      typed recursively ({ [field: string]: true | ReferenceSelectionSet }), matching the nested
      selections @key/@requires/@provides produce. oldVisit's visitor param is typed as
      OldVisitor: enter and leave maps keyed by AST node kind, whose callbacks receive the typed
      node plus graphql's key, parent, path and ancestors. Federation directives missing their
      fields argument, and operations whose root type is missing from the schema, throw a
      descriptive error.
    • @graphql-codegen/typescript and @graphql-codegen/typescript-operations: the
      InputValueDefinition visitor methods take path and ancestors as required params, since the
      visitor always passes them.

    Generated output is unchanged.

  • #11009
    1f7566f
    Thanks @eddeee888! - Fix type errors in typescript-operations
    under strict: true by widening the shared types it calls into:

    • @graphql-codegen/plugin-helpers: Types.ComplexPluginOutput's prepend and append now
      accept null items. Core already skipped them.
    • @graphql-codegen/visitor-plugin-common: DeclarationBlock.withComment accepts undefined,
      parseEnumValues's mapOrStr is optional (it already defaulted to {}),
      ImportSource.namespace accepts null, and optimizeOperations's includeFragments is
      optional.
    • @graphql-codegen/typescript-operations: skips document files without a document, and no
      longer throws when called without the plugin info argument.

    Generated output is unchanged.

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

NewReleases is sending notifications on new releases.