@graphql-codegen/cli@7.0.0
Major Changes
-
#10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
only support ESMNode 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: SetnoSilentErrors: true
by defaultWhen 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: trueis used as the default for Codegen users to make the feedback loop faster.
It can still overriden in Codegen Config if desired.
Patch Changes
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
@inquirer/prompts@^8.3.2↗︎ (from
^7.8.2, independencies) - Updated dependency
chalk@^5.6.0↗︎ (from
^4.1.0, independencies) - Updated dependency
debounce@^3.0.0↗︎ (from
^2.0.0, independencies) - Updated dependency
detect-indent@^7.0.0↗︎ (from^6.0.0,
independencies) - Updated dependency
listr2@^10.2.1↗︎ (from
^9.0.0, independencies) - Updated dependency
log-symbols@^7.0.0↗︎
(from^4.0.0, independencies) - Updated dependency
ts-log@^3.0.0↗︎ (from
^2.2.3, independencies) - Updated dependency
yargs@^18.0.0↗︎ (from
^17.0.0, independencies)
- Updated dependency
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
chalk@^5.6.0↗︎ (from
^4.1.0, independencies) - Updated dependency
debounce@^3.0.0↗︎ (from
^2.0.0, independencies) - Updated dependency
detect-indent@^7.0.0↗︎ (from^6.0.0,
independencies) - Updated dependency
listr2@^10.2.1↗︎ (from
^9.0.0, independencies) - Updated dependency
log-symbols@^7.0.0↗︎
(from^4.0.0, independencies) - Updated dependency
ts-log@^3.0.0↗︎ (from
^2.2.3, independencies) - Updated dependency
yargs@^18.0.0↗︎ (from
^17.0.0, independencies)
- Updated dependency
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
@inquirer/prompts@^8.3.2↗︎ (from
^7.8.2, independencies)
- Updated dependency
-
#10496
afaace6
Thanks @eddeee888! - Use ESM for CLI instead of CJS;For backwards compatibility;
graphql-codegen-esmis reserved, and alsographql-codegen-cjsis
added for users who want to use CJS.So the commands are;
graphql-codegen- ESM version, defaultgraphql-codegen-esm- ESM version, same as above, but reserved for backwards compatibilitygraphql-codegen-cjs- CJS version, for users who want to use CJS, but not recommended for new
users. Will be removed in the future.gql-gen- ESM version, same asgraphql-codegengraphql-code-generator- ESM version, same asgraphql-codegenandgql-gen
-
Updated dependencies
[afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6]:- @graphql-codegen/client-preset@6.0.0
- @graphql-codegen/plugin-helpers@7.0.0
- @graphql-codegen/core@6.0.0
@graphql-codegen/core@6.0.0
Major Changes
- #10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Drop Node 20 support
Patch Changes
@graphql-codegen/add@7.0.0
Major Changes
- #10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Drop Node 20 support
Patch Changes
@graphql-codegen/fragment-matcher@7.0.0
Major Changes
- #10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Drop Node 20 support
Patch Changes
@graphql-codegen/introspection@6.0.0
Major Changes
- #10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Drop Node 20 support
Patch Changes
- Updated dependencies
[afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6]:- @graphql-codegen/plugin-helpers@7.0.0
- @graphql-codegen/visitor-plugin-common@7.0.0
@graphql-codegen/schema-ast@6.0.0
Major Changes
- #10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Drop Node 20 support
Patch Changes
@graphql-codegen/time@7.0.0
Major Changes
- #10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Drop Node 20 support
Patch Changes
@graphql-codegen/visitor-plugin-common@7.0.0
Major Changes
-
#10496
afaace6
Thanks @eddeee888! - Fix nullable field optionality in operationsPreviously, 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 benull, and
notundefined(both missing from the object ORundefined). The only exceptions are when fields
are deferred (using@deferdirective) or marked as conditional (using@skipor@include).Now, a nullable Result field cannot be optional unless the exceptions are met. This also limits
avoidOptionalsto only target Variables input, since some users may want to force explicit
nullwhen 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-visitorandtypescript-operationsvisitor - types-visitor: includes
base-types-visitorandtypescriptvisitor - resolvers-visitor: includes
base-resolvers-visitorandtypescript-resolversvisitor
- addTypename/skipTypename: is only a types-visitor concern. This is moved to types-visitor from
-
#10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: makeunknowninstead of
anythe default custom scalar type -
#10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
only support ESMNode 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'sbase-types-visitorno longer hasgetNodeCommentor
buildEnumValuesBlockmethod. -
#10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Operation plugin and Client
Preset no longer generates optional__typenamefor result type__typenamshould 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: trueand
skipTypeNameForRoot: trueto ensure generated types match the runtime behaviour. -
#10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Remove unused utility types
fromtypescriptplugin as they were previously used fortypescript-operationsplugin:MakeOptionalMakeMaybeMakeEmptyIncremental
BREAKING CHANGE: Remove
getRootTypeNamesfunction because it's available in
@graphql-utils/toolsand not used anywhere
Minor Changes
-
#10496
afaace6
Thanks @eddeee888! - Add support for declarationKind for
typescript-operations- Input: can only be
typeorinterface - Variables: no support. It must always be
typebecause it's an alias e.g.
Variables = Exact<{ something: type }> - Result: can only be
typeorinterface- Note: when
extractAllFieldsToTypes:trueorextractAllFieldsToTypesCompact:true, Results
are used as type alias, so they are forced to betype. There is a console warning for users.
- Note: when
- Input: can only be
-
#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
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
auto-bind@^5.0.0↗︎ (from
~4.0.0, independencies) - Updated dependency
change-case-all@^2.1.0↗︎ (from
1.0.15, independencies)
- Updated dependency
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
auto-bind@^5.0.0↗︎ (from
~4.0.0, independencies) - Updated dependency
change-case-all@^2.1.0↗︎ (from
1.0.15, independencies)
- Updated dependency
-
#10496
afaace6
Thanks @eddeee888! - ImprovenamespacedImportNameusability by
setting a default whenimportSchemaTypesFromis set -
#10496
afaace6
Thanks @eddeee888! - AddprintTypeScriptMaybeTypeto handle
printing TS types, as there are special cases likeanyandunknown -
#10496
afaace6
Thanks @eddeee888! - Fix isNativeNamedType to handle types from
remote schemas correctlyPreviously, we assumed that if a name type does note have
astNode, it is a native named type
because it is not declared in user's schema.However, this is a wrong assumption because remote schemas do not have
astNode. This causes all
user declared types are wrongly recognised as native types e.g. Input -
#10496
afaace6
Thanks @eddeee888! - Ensure Input and Variables use the same input
scalars default e.g.IDcan takestring | number -
#10496
afaace6
Thanks @eddeee888! - Fix namingConvention not being applied
consistently -
#10496
afaace6
Thanks @eddeee888! - Abstract how enum imports are generated into
visitor-plugin-common package -
#10496
afaace6
Thanks @eddeee888! - Fix namingConvention not being applied
consistently in imports, Variables, Input and Result -
Updated dependencies
[afaace6,
afaace6,
afaace6,
afaace6]:- @graphql-codegen/plugin-helpers@7.0.0
@graphql-codegen/typescript-document-nodes@6.0.0
Major Changes
-
#10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
only support ESMNode 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
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
auto-bind@^5.0.0↗︎ (from
~4.0.0, independencies)
- Updated dependency
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
auto-bind@^5.0.0↗︎ (from
~4.0.0, independencies)
- Updated dependency
-
Updated dependencies
[afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6]:- @graphql-codegen/plugin-helpers@7.0.0
- @graphql-codegen/visitor-plugin-common@7.0.0
@graphql-codegen/gql-tag-operations@6.0.0
Major Changes
-
#10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
only support ESMNode 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
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
auto-bind@^5.0.0↗︎ (from
~4.0.0, independencies)
- Updated dependency
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
auto-bind@^5.0.0↗︎ (from
~4.0.0, independencies)
- Updated dependency
-
Updated dependencies
[afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6]:- @graphql-codegen/plugin-helpers@7.0.0
- @graphql-codegen/visitor-plugin-common@7.0.0
@graphql-codegen/typescript-operations@6.0.0
Major Changes
-
#10496
afaace6
Thanks @eddeee888! - Fix nullable field optionality in operationsPreviously, 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 benull, and
notundefined(both missing from the object ORundefined). The only exceptions are when fields
are deferred (using@deferdirective) or marked as conditional (using@skipor@include).Now, a nullable Result field cannot be optional unless the exceptions are met. This also limits
avoidOptionalsto only target Variables input, since some users may want to force explicit
nullwhen 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-visitorandtypescript-operationsvisitor - types-visitor: includes
base-types-visitorandtypescriptvisitor - resolvers-visitor: includes
base-resolvers-visitorandtypescript-resolversvisitor
- addTypename/skipTypename: is only a types-visitor concern. This is moved to types-visitor from
-
#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: makeunknowninstead of
anythe default custom scalar type -
#10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
only support ESMNode 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-operationsplugin fromtypescriptpluginPreviously,
TypeScriptOperationVariablesToObjectfromtypescript-operationswas extending from
typescriptplugin. 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! - Thetypescript-operationsplugin no longer
generates InputMaybe and Scalars types; it now uses native Typescript types instead. -
#10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE:typescriptplugin no
longer generatesExactutility type. Instead,typescript-operationsgenerates said utility
type for every file it creates. This is because it is used only forVariables, 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__typenamefor result type__typenamshould 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: trueand
skipTypeNameForRoot: trueto 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
typeorinterface - Variables: no support. It must always be
typebecause it's an alias e.g.
Variables = Exact<{ something: type }> - Result: can only be
typeorinterface- Note: when
extractAllFieldsToTypes:trueorextractAllFieldsToTypesCompact:true, Results
are used as type alias, so they are forced to betype. There is a console warning for users.
- Note: when
- Input: can only be
-
#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
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
auto-bind@^5.0.0↗︎ (from
~4.0.0, independencies) - Added dependency
@graphql-codegen/schema-ast@^5.0.1↗︎
(todependencies) - Removed dependency
@graphql-codegen/typescript@^5.0.10↗︎
(fromdependencies)
- Updated dependency
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Added dependency
@graphql-codegen/schema-ast@^5.0.0↗︎
(todependencies)
- Added dependency
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Removed dependency
@graphql-codegen/typescript@^5.0.7↗︎
(fromdependencies)
- Removed dependency
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
auto-bind@^5.0.0↗︎ (from
~4.0.0, independencies)
- Updated dependency
-
#10496
afaace6
Thanks @eddeee888! - ImprovenamespacedImportNameusability by
setting a default whenimportSchemaTypesFromis set -
#10496
afaace6
Thanks @eddeee888! - Add internal utility type warning to deter
usage -
#10496
afaace6
Thanks @eddeee888! - AddprintTypeScriptMaybeTypeto handle
printing TS types, as there are special cases likeanyandunknown -
#10496
afaace6
Thanks @eddeee888! - Re-implement inputMaybeValue -
#10496
afaace6
Thanks @eddeee888! - Only generateExactutility type at the top
if it is usedExactutility is only used to wrap variables types for operations (queries, mutations and
subscriptions) if they exist in the document.Exactis never used when there are only
fragments.This is important to conditionally generate as users may use very strict tsconfig that will fail
compiling if there are unused types. -
#10496
afaace6
Thanks @eddeee888! - Fix external custom scalars not getting
imported -
#10496
afaace6
Thanks @eddeee888! - Ensure Input and Variables use the same input
scalars default e.g.IDcan takestring | number -
#10496
afaace6
Thanks @eddeee888! - Fix@skipand@includenot applying
conditional modifiers correctly when used on inline fragment -
#10496
afaace6
Thanks @eddeee888! - Abstract how enum imports are generated into
visitor-plugin-common package -
#10496
afaace6
Thanks @eddeee888! - Fix@skipand@includenot applying
conditional modifiers correctly when used on fragment sread, and@deferfragments -
#10496
afaace6
Thanks @eddeee888! - Fix importing issue of Input when
importSchemaTypesFrom is used -
#10496
afaace6
Thanks @eddeee888! - Fix namingConvention not being applied
consistently in imports, Variables, Input and Result -
Updated dependencies
[afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6]:- @graphql-codegen/plugin-helpers@7.0.0
- @graphql-codegen/visitor-plugin-common@7.0.0
- @graphql-codegen/schema-ast@6.0.0
@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-visitorandtypescript-operationsvisitor - types-visitor: includes
base-types-visitorandtypescriptvisitor - resolvers-visitor: includes
base-resolvers-visitorandtypescript-resolversvisitor
- addTypename/skipTypename: is only a types-visitor concern. This is moved to types-visitor from
-
#10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: makeunknowninstead of
anythe default custom scalar type -
#10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
only support ESMNode 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
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
auto-bind@^5.0.0↗︎ (from
~4.0.0, independencies)
- Updated dependency
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
auto-bind@^5.0.0↗︎ (from
~4.0.0, independencies)
- Updated dependency
-
#10496
afaace6
Thanks @eddeee888! - Fix namingConvention not being applied
consistently -
#10496
afaace6
Thanks @eddeee888! - Abstract how enum imports are generated into
visitor-plugin-common package -
Updated dependencies
[afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6]:- @graphql-codegen/plugin-helpers@7.0.0
- @graphql-codegen/typescript@6.0.0
- @graphql-codegen/visitor-plugin-common@7.0.0
@graphql-codegen/typed-document-node@7.0.0
Major Changes
-
#10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
only support ESMNode 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
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
auto-bind@^5.0.0↗︎ (from
~4.0.0, independencies) - Updated dependency
change-case-all@^2.1.0↗︎ (from
1.0.15, independencies)
- Updated dependency
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
change-case-all@^2.1.0↗︎ (from
1.0.15, independencies) - Updated dependency
auto-bind@^5.0.0↗︎ (from
~4.0.0, independencies)
- Updated dependency
-
Updated dependencies
[afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6]:- @graphql-codegen/plugin-helpers@7.0.0
- @graphql-codegen/visitor-plugin-common@7.0.0
@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-visitorandtypescript-operationsvisitor - types-visitor: includes
base-types-visitorandtypescriptvisitor - resolvers-visitor: includes
base-resolvers-visitorandtypescript-resolversvisitor
- addTypename/skipTypename: is only a types-visitor concern. This is moved to types-visitor from
-
#10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: makeunknowninstead of
anythe default custom scalar type -
#10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
only support ESMNode 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:typescriptplugin no
longer generatesExactutility type. Instead,typescript-operationsgenerates said utility
type for every file it creates. This is because it is used only forVariables, so we only need
to generate it once for every generated operation file. -
#10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Remove unused utility types
fromtypescriptplugin as they were previously used fortypescript-operationsplugin:MakeOptionalMakeMaybeMakeEmptyIncremental
BREAKING CHANGE: Remove
getRootTypeNamesfunction because it's available in
@graphql-utils/toolsand not used anywhere
Minor Changes
- #10496
afaace6
Thanks @eddeee888! - Thetypescript-operationsplugin no longer
generates InputMaybe and Scalars types; it now uses native Typescript types instead.
Patch Changes
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
auto-bind@^5.0.0↗︎ (from
~4.0.0, independencies) - Updated dependency
tslib@~2.6.0↗︎ (from
^2.8.0, independencies)
- Updated dependency
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
auto-bind@^5.0.0↗︎ (from
~4.0.0, independencies)
- Updated dependency
-
#10496
afaace6
Thanks @eddeee888! - Extract utilities from base-type-visitor to
be shared with other plugins later: convertSchemaEnumToDeclarationBlockString, getNodeComment -
#10496
afaace6
Thanks @eddeee888! - Fix namingConvention not being applied
consistently -
#10496
afaace6
Thanks @eddeee888! - Abstract how enum imports are generated into
visitor-plugin-common package -
#10496
afaace6
Thanks @eddeee888! - Fix namingConvention not being applied
consistently in imports, Variables, Input and Result -
Updated dependencies
[afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6]:- @graphql-codegen/plugin-helpers@7.0.0
- @graphql-codegen/visitor-plugin-common@7.0.0
- @graphql-codegen/schema-ast@6.0.0
@graphql-codegen/client-preset@6.0.0
Major Changes
-
#10496
afaace6
Thanks @eddeee888! - Fix nullable field optionality in operationsPreviously, 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 benull, and
notundefined(both missing from the object ORundefined). The only exceptions are when fields
are deferred (using@deferdirective) or marked as conditional (using@skipor@include).Now, a nullable Result field cannot be optional unless the exceptions are met. This also limits
avoidOptionalsto only target Variables input, since some users may want to force explicit
nullwhen providing operation variables. -
#10496
afaace6
Thanks @eddeee888! - Conditionally generate input types and output
enums into target file -
#10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: makeunknowninstead of
anythe default custom scalar type -
#10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
only support ESMNode 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:typescriptplugin no
longer generatesExactutility type. Instead,typescript-operationsgenerates said utility
type for every file it creates. This is because it is used only forVariables, 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__typenamefor result type__typenamshould 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: trueand
skipTypeNameForRoot: trueto 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
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Removed dependency
@graphql-codegen/typescript@^5.0.8↗︎
(fromdependencies)
- Removed dependency
-
#10496
afaace6
Thanks @eddeee888! - Remove @graphql-codegen/typescript from
client-preset dep as the preset no longer uses the plugin. -
#10496
afaace6
Thanks @eddeee888! - Abstract how enum imports are generated into
visitor-plugin-common package -
Updated dependencies
[afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6]:- @graphql-codegen/gql-tag-operations@6.0.0
- @graphql-codegen/plugin-helpers@7.0.0
- @graphql-codegen/typed-document-node@7.0.0
- @graphql-codegen/typescript@6.0.0
- @graphql-codegen/typescript-operations@6.0.0
- @graphql-codegen/visitor-plugin-common@7.0.0
- @graphql-codegen/add@7.0.0
@graphql-codegen/graphql-modules-preset@6.0.0
Major Changes
-
#10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
only support ESMNode 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
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
change-case-all@^2.1.0↗︎ (from
1.0.15, independencies)
- Updated dependency
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
change-case-all@^2.1.0↗︎ (from
1.0.15, independencies)
- Updated dependency
-
Updated dependencies
[afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6,
afaace6]:- @graphql-codegen/plugin-helpers@7.0.0
- @graphql-codegen/visitor-plugin-common@7.0.0
@graphql-codegen/testing@5.0.0
Major Changes
- #10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Drop Node 20 support
Patch Changes
@graphql-codegen/plugin-helpers@7.0.0
Major Changes
-
#10496
afaace6
Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some
only support ESMNode 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
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
change-case-all@^2.1.0↗︎ (from
1.0.15, independencies)
- Updated dependency
-
#10496
afaace6
Thanks @eddeee888! - dependencies updates:- Updated dependency
change-case-all@^2.1.0↗︎ (from
1.0.15, independencies)
- Updated dependency