unstale

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

@graphql-codegen/visitor-plugin-common

What changed in @graphql-codegen/visitor-plugin-common 2 to 8, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-26.

25 breaking15 new APIs and options2 behavior and defaults5 tooling69 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.3.1 on npm

@graphql-codegen/visitor-plugin-common 811 changes

Breaking changes 7

  • The CLI flag was removed; use --import-extension to set the extension appended to relative imports.

    8.0.0release notes

  • The deprecated config option was removed; use importExtension to set the extension appended to relative imports.

    8.0.0release notes

  • GraphQL 14 and 15 are no longer supported; the peer dependency now requires GraphQL 16 or 17.

    8.0.0release notes

  • Version 9 extracts #graphql-marked template literals by default, which can result in newly found documents; set pluckConfig.gqlHashComment to an empty string to retain the previous behavior.

    8.0.0release notes

  • Node.js versions below 22.18.0 are no longer supported.

    8.0.0release notes

  • @graphql-codegen/plugin-helpers no longer exports this function; use importExtension ?? '' instead.

    8.0.0release notes

  • Set pluckConfig: { gqlHashComment: '' } to keep the previous behavior of not extracting #graphql-marked template literals by default.

    8.0.0release notes

New APIs and options 2

  • This parser option enables support for GraphQL v17 fragment arguments when set in the root config.

    8.0.0release notes

  • Use this option to set the extension appended to relative imports; when unset, no extension is appended.

    8.0.0release notes

Fixes and other changes 2

  • Uses the generated enum instead of null in ResolversTypes when enumValues maps an enum with an object.

    8.0.2release notes

  • Fixes typesPrefix being applied to enum keys when generating enums as const.

    8.0.1release notes

@graphql-codegen/visitor-plugin-common 793 changes

Breaking changes 14

  • Throws a descriptive error when an enum value is not defined on the schema's enum, and treats a non-enum schema type with the enum's name as having no schema enum.

    7.2.10release notes

  • _selectionSetToObject is optional because it is only set by setSelectionSetHandler; affected methods now throw descriptive errors when it is not set.

    7.2.8release notes

  • defaultMapperType throws a descriptive error when the defaultMapper config is not set.

    7.2.8release notes

  • FieldDefinition visitor parameters are typed, with key and parent required because the visitor always passes them.

    7.2.8release notes

  • InputValueDefinition visitor parameters are typed, with key and parent required because the visitor always passes them.

    7.2.8release notes

  • ListType visitor parameters are typed, with key and parent required because the visitor always passes them.

    7.2.8release notes

  • UnionTypeDefinition visitor parameters are typed, with key and parent required because the visitor always passes them.

    7.2.8release notes

  • Multiple-field @oneOf inputs are generated as a type alias even when declarationKind is interface; single-field inputs keep the configured declarationKind.input.

    7.2.7release notes

  • The exported helper is removed.

    7.2.6release notes

  • The default custom scalar type is now unknown instead of any.

    7.0.0release notes

  • The base-types-visitor no longer has this method.

    7.0.0release notes

  • Node 20 support is dropped; users are advised to upgrade to Node 22.

    7.0.0release notes

  • Nullable Result fields are no longer optional unless deferred with @defer or conditional with @skip or @include; avoidOptionals now only targets Variables input.

    7.0.0release notes

  • Operation plugin and Client Preset no longer generate optional __typename for result types unless it is requested or injected by a client.

    7.0.0release notes

New APIs and options 11

  • Adds the native-with-string-values enum type, allowing operation variables and input object fields to accept either an enum member or its string value.

    7.5.0release notes

  • Adds an option that, with documentMode: graphQLTag, includes spread fragments in each fragment document so it can be used on its own; defaults to false, and operation documents do not change.

    7.4.0release notes

  • Adds plainString mode, generating documents as plain template strings with embedded fragments instead of TypedDocumentString instances; each document is typed as string.

    7.3.0release notes

  • Returns the default reason for a @deprecated directive without arguments.

    7.2.10release notes

  • Adds a type representing every declaration kind set, used by declaration-kind normalization and parsed types configuration.

    7.2.8release notes

  • A new export provides the shared @oneOf input declaration-kind rule for typescript and typescript-operations.

    7.2.7release notes

  • Creates typedDocumentString to support TypedDocumentString usage, common in Client-side plugins when documentMode=string.

    7.1.0release notes

  • Added support for typescript-operations: Input and Result can be type or interface; Variables remain type, and extracted Results are forced to type.

    7.0.0release notes

  • Added an option that renders nested type names with field names only, without types.

    7.0.0release notes

  • Added to typescript-operations to allow omitting operation types such as Variables, selection sets, and Fragment types.

    7.0.0release notes

  • Added support for importSchemaTypesFrom.

    7.0.0release notes

Behavior and default changes 2

  • rawMappers defaults to {}.

    7.2.10release notes

  • A default is now set for namespacedImportName when importSchemaTypesFrom is set.

    7.0.0release notes

Tooling 5

  • Moved from base-visitor to types-visitor; it is now a types-visitor concern.

    7.0.0release notes

  • Moved from base-visitor to documents-visitor.

    7.0.0release notes

  • Moved from base-visitor to documents-visitor.

    7.0.0release notes

  • Moved from base-visitor to documents-visitor and types-visitor.

    7.0.0release notes

  • Moved from base-visitor to documents-visitor and types-visitor.

    7.0.0release notes

Fixes and other changes 61

  • SchemaDefinition() and SchemaExtension() are typed to return null instead of any.

    7.2.10release notes

  • May return null, matching its existing return behavior.

    7.2.10release notes

  • Its parameter is typed as string[] | null | undefined, matching its empty-string handling.

    7.2.10release notes

  • Accepts an undefined scalars mapping and uses only the defaults and the schema.

    7.2.10release notes

  • Accepts nullish identifier and source, and throws a descriptive error when either is missing.

    7.2.10release notes

  • Treats an enum node without values as empty instead of throwing.

    7.2.10release notes

  • When blockTransformer is undefined, the block is returned unchanged instead of throwing.

    7.2.10release notes

  • Fields are typed as string | null, with _name typed as string | NameNode | null.

    7.2.10release notes

  • Accepts null, which renders the same as no block.

    7.2.10release notes

  • Treats missing identifiers as empty.

    7.2.10release notes

  • The type parameter accepts null, which graphql 15's schema.getType() can return.

    7.2.10release notes

  • Returns false instead of undefined.

    7.2.10release notes

  • getName and transform may return null, matching their existing return behavior.

    7.2.10release notes

  • Emits an empty string instead of the text undefined or null when a variable has no name or type identifier.

    7.2.10release notes

  • Throws a descriptive error when a document file has no parsed document.

    7.2.10release notes

  • These fields accept null, matching values already emitted by parseEnumValues.

    7.2.10release notes

  • Returned nodes use description: undefined instead of any.

    7.2.10release notes

  • The returned typeInfo is typed as { name: string; type: string } | null.

    7.2.10release notes

  • Accepts undefined and null, which it handles by returning an empty string.

    7.2.10release notes

  • The default key uses String(item).

    7.2.10release notes

  • Input objects, objects, interfaces, unions and enums without fields, types, values or description are treated as empty instead of throwing.

    7.2.9release notes

  • The constructor accepts additionalConfig as Partial<TPluginConfig>, since the visitor fills in defaults for omitted keys.

    7.2.9release notes

  • FragmentDefinition may return null and reports a descriptive error when the fragment's type condition is absent from the schema.

    7.2.8release notes

  • OperationDefinition throws a descriptive error when _selectionSetToObject is not set.

    7.2.8release notes

  • The constructor accepts Partial<TPluginConfig> for additionalConfig because omitted keys receive defaults.

    7.2.8release notes

  • DirectiveDefinition may return null, matching behavior for skipped directives.

    7.2.8release notes

  • EnumTypeDefinition may return null for enums without mappers or enumValues.

    7.2.8release notes

  • getAbstractMembersType's isTypenameNonOptional parameter is optional, matching the optional configuration flags it reads.

    7.2.8release notes

  • ScalarTypeDefinition may return null, matching behavior for skipped federation scalars.

    7.2.8release notes

  • The typeCache key type is Location | undefined.

    7.2.8release notesrelease notes

  • DirectiveDefinition may return null, matching its supported visitor result.

    7.2.8release notes

  • EnumTypeDefinition may return null, matching its supported visitor result.

    7.2.8release notes

  • NamedType visitor parameters are typed, with key and parent required because the visitor always passes them.

    7.2.8release notes

  • ObjectTypeDefinition may return null, matching its supported visitor result.

    7.2.8release notes

  • buildOperation may return null, matching the base implementation's existing behavior.

    7.2.8release notes

  • withComment accepts undefined, fixing strict TypeScript errors when the argument may be undefined.

    7.2.8release notes

  • Accepts any GraphQLType or undefined and returns a copy of possible types rather than the schema's readonly array.

    7.2.8release notes

  • namespace accepts null, fixing strict TypeScript errors for nullable values.

    7.2.8release notes

  • alias is optional, matching link fields built for fields without an alias.

    7.2.8release notes

  • transform accepts undefined and returns null, matching its existing behavior.

    7.2.8release notes

  • includeFragments is optional, matching the accepted call shape.

    7.2.8release notes

  • mapOrStr is optional, matching its existing default to an empty object.

    7.2.8release notes

  • transformSelectionSet declares its return type and throws a descriptive error when the instance has no selection set.

    7.2.8release notes

  • Selection set type cache keys now reference fragment spreads by name instead of using expanded field paths, keeping key growth linear and fixing out-of-memory errors.

    7.2.6release notes

  • The value parameter is typed as T | null | undefined, allowing the result to be non-nullable when given a non-nullable default.

    7.2.6release notes

  • Fixes union and conditional directives resulting in no field types.

    7.2.5release notes

  • Reverts Partial handling when conditional fragments and fragment masking are used, preventing all masked fields from becoming optional due to function type override.

    7.2.4release notes

  • Fixes fragment masking generation when a conditional directive is used.

    7.2.3release notes

  • Prevents @skip and @include from incorrectly dropping fields in Result when used on an Inline Fragment or Fragment Spread.

    7.2.2release notes

  • Stops emitting an empty import statement when an import source has no identifiers and no namespace.

    7.2.2release notes

  • Fixes duplicate type generation when extractAllFieldsToTypes=true is used with @defer.

    7.2.1release notes

  • Handles conditional spreads of fragments whose top-level selections are fragment spreads or contain inline fragments.

    7.1.2release notes

  • _fragments is protected instead of private.

    7.1.1release notes

  • Fragments are now deduplicated when documentMode is set to graphQLTag.

    7.0.4release notes

  • Conditional selection separation is skipped when extractAllFieldsToTypesCompact is enabled.

    7.0.2release notes

  • Fixes incorrect application of typesPrefix to const enums.

    7.0.1release notes

  • Fixes incorrect application of typesSuffix to const enums.

    7.0.1release notes

  • Moved to base-visitor so all three visitor types correctly synchronize enum type names.

    7.0.0release notes

  • Input and Variables now use the same input scalar defaults, such as ID accepting string or number.

    7.0.0release notes

  • Fixed handling of types from remote schemas, which lack astNode and were incorrectly recognized as native types.

    7.0.0release notes

  • Fixed inconsistent application of namingConvention, including in imports, Variables, Input, and Result.

    7.0.0release notes

@graphql-codegen/visitor-plugin-common 68 changes

New APIs and options 2

  • Declares GraphQL documents that are read and available to plugins for type resolution but do not generate output files.

    6.3.0release notes

  • Adds the importExtension configuration option.

    6.2.0release notes

Fixes and other changes 6

  • Fixes an invalid extracted concrete type name on a shared interface.

    6.2.3release notes

  • Fixes fragment type generation names.

    6.2.2release notes

  • Use the parent type name for interface types without fragments.

    6.2.1release notes

  • Mappers configured for root types can now override rootValueType; previously, root types were checked before mappers.

    6.2.0release notes

  • Fixes nested fragments not receiving the correct meta field in Client Preset.

    6.1.2release notes

  • The visitor now handles schema extension nodes correctly when a schema has no operation type defined and extensions contain directives.

    6.1.1release notes

@graphql-codegen/visitor-plugin-common 31 changes

Breaking changes 1

@graphql-codegen/visitor-plugin-common 23 changes

Breaking changes 3

  • Adds an option for deep inlining fragment types within operation types; it defaults to inline, replacing the previous combine behavior.

    2.0.0release notes

  • Node 10 is no longer supported by graphql-tools or Codegen packages.

    2.0.0release notes

  • The default for preResolveTypes is now true, producing more readable types.

    2.0.0release notes