Repository navigation
chore(deps): update graphqlcodegenerator monorepo - #1595
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
7.4.3→7.4.47.4.0→7.4.16.1.0→6.1.17.2.7→7.2.8Release Notes
dotansimha/graphql-code-generator (@graphql-codegen/cli)
v7.4.4Compare Source
Patch Changes
#11025
43d0f65Thanks @BuddhaBing! - Widen
Types.SchemaWithLoaderOptions['loader']to accept a custom loader function(
CustomSchemaLoaderFn) in addition to a path string.A per-entry
schemacustom loader ({ '<pointer>': { loader, ...options } }) is resolved by@graphql-tools/load'suseCustomLoader, which already accepts either a path string (resolvedvia
require()) or a function value at runtime (typeof loaderPointer === 'function'). Only theTypeScript type restricted
loadertostring, forcing consumers who pass an imported loaderfunction (or a class instance exposing a bound
loaderproperty) to cast theschemaarray tobypass the type error, even though it worked correctly at runtime.
This is additive and backward compatible —
loader: stringcontinues to type-check exactly asbefore.
Also fixes a schema-cache collision for function loaders in
@graphql-codegen/cli: the cache keyis
JSON.stringify(schemaPointerMap), andJSON.stringifydrops functions, so twogeneratestargets 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 nowkeyed by object identity (via the existing
getJsObjectId), so distinct loaders load separatelywhile one function reused across targets still loads once.
#11020
82ebbb5Thanks @eddeee888! - Fix type errors in
cliunderstrict: true:@graphql-codegen/cli:loadCodegenConfigreturnsPromise<LoadCodegenConfigResult | null>,matching the
nullit resolves to when no config file is found.YamlCliFlagsincludes thekebab-case
ignore-no-documents,emit-legacy-common-js-importsandimport-extensionflagsthat the CLI reads.
CodegenContext.filepathis optional, and watch mode only watches theconfig file when the context has a
filepath.CodegenContext.getConfig()without an argumentreturns
Types.Config, andgetConfig(extraConfig)returnsT & Types.Config.CodegenContext.checkModeStaleFilesis typed asstring[]. Adds@types/yargs,@types/babel__generatorand@types/babel__templateas dev dependencies.@graphql-codegen/plugin-helpers:normalizeInstanceOrArrayandnormalizeConfigacceptnullandundefined, returning[].Generated output is unchanged.
Updated dependencies
[
43d0f65,82ebbb5,e972b6d,eae0e62,1f7566f]:dotansimha/graphql-code-generator (@graphql-codegen/plugin-helpers)
v7.4.1Compare Source
Patch Changes
#11025
43d0f65Thanks @BuddhaBing! - Widen
Types.SchemaWithLoaderOptions['loader']to accept a custom loader function(
CustomSchemaLoaderFn) in addition to a path string.A per-entry
schemacustom loader ({ '<pointer>': { loader, ...options } }) is resolved by@graphql-tools/load'suseCustomLoader, which already accepts either a path string (resolvedvia
require()) or a function value at runtime (typeof loaderPointer === 'function'). Only theTypeScript type restricted
loadertostring, forcing consumers who pass an imported loaderfunction (or a class instance exposing a bound
loaderproperty) to cast theschemaarray tobypass the type error, even though it worked correctly at runtime.
This is additive and backward compatible —
loader: stringcontinues to type-check exactly asbefore.
Also fixes a schema-cache collision for function loaders in
@graphql-codegen/cli: the cache keyis
JSON.stringify(schemaPointerMap), andJSON.stringifydrops functions, so twogeneratestargets 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 nowkeyed by object identity (via the existing
getJsObjectId), so distinct loaders load separatelywhile one function reused across targets still loads once.
#11020
82ebbb5Thanks @eddeee888! - Fix type errors in
cliunderstrict: true:@graphql-codegen/cli:loadCodegenConfigreturnsPromise<LoadCodegenConfigResult | null>,matching the
nullit resolves to when no config file is found.YamlCliFlagsincludes thekebab-case
ignore-no-documents,emit-legacy-common-js-importsandimport-extensionflagsthat the CLI reads.
CodegenContext.filepathis optional, and watch mode only watches theconfig file when the context has a
filepath.CodegenContext.getConfig()without an argumentreturns
Types.Config, andgetConfig(extraConfig)returnsT & Types.Config.CodegenContext.checkModeStaleFilesis typed asstring[]. Adds@types/yargs,@types/babel__generatorand@types/babel__templateas dev dependencies.@graphql-codegen/plugin-helpers:normalizeInstanceOrArrayandnormalizeConfigacceptnullandundefined, returning[].Generated output is unchanged.
#11019
eae0e62Thanks @eddeee888! - Fix type errors in
plugin-helpersunderstrict: true:@graphql-codegen/plugin-helpers:ProfilerEvent.catis optional, matching the Trace Eventformat and
Profiler.run's optionalcat.FederationMeta's reference selection sets aretyped recursively (
{ [field: string]: true | ReferenceSelectionSet }), matching the nestedselections
@key/@requires/@providesproduce.oldVisit'svisitorparam is typed asOldVisitor:enterandleavemaps keyed by AST node kind, whose callbacks receive the typednode plus graphql's
key,parent,pathandancestors. Federation directives missing theirfieldsargument, and operations whose root type is missing from the schema, throw adescriptive error.
@graphql-codegen/typescriptand@graphql-codegen/typescript-operations: theInputValueDefinitionvisitor methods takepathandancestorsas required params, since thevisitor always passes them.
Generated output is unchanged.
#11009
1f7566fThanks @eddeee888! - Fix type errors in
typescript-operationsunder
strict: trueby widening the shared types it calls into:@graphql-codegen/plugin-helpers:Types.ComplexPluginOutput'sprependandappendnowaccept
nullitems. Core already skipped them.@graphql-codegen/visitor-plugin-common:DeclarationBlock.withCommentacceptsundefined,parseEnumValues'smapOrStris optional (it already defaulted to{}),ImportSource.namespaceacceptsnull, andoptimizeOperations'sincludeFragmentsisoptional.
@graphql-codegen/typescript-operations: skips document files without adocument, and nolonger throws when called without the plugin info argument.
Generated output is unchanged.
dotansimha/graphql-code-generator (@graphql-codegen/typescript)
v6.1.1Compare Source
Patch Changes
#11019
eae0e62Thanks @eddeee888! - Fix type errors in
plugin-helpersunderstrict: true:@graphql-codegen/plugin-helpers:ProfilerEvent.catis optional, matching the Trace Eventformat and
Profiler.run's optionalcat.FederationMeta's reference selection sets aretyped recursively (
{ [field: string]: true | ReferenceSelectionSet }), matching the nestedselections
@key/@requires/@providesproduce.oldVisit'svisitorparam is typed asOldVisitor:enterandleavemaps keyed by AST node kind, whose callbacks receive the typednode plus graphql's
key,parent,pathandancestors. Federation directives missing theirfieldsargument, and operations whose root type is missing from the schema, throw adescriptive error.
@graphql-codegen/typescriptand@graphql-codegen/typescript-operations: theInputValueDefinitionvisitor methods takepathandancestorsas required params, since thevisitor always passes them.
Generated output is unchanged.
#11014
7a376efThanks @eddeee888! - Fix type errors in
typescriptunderstrict: trueby typing the shared visitor methods it overrides:@graphql-codegen/visitor-plugin-common: addsNormalizedDeclarationKindConfig(everydeclaration kind set), used by
normalizeDeclarationKind,DEFAULT_DECLARATION_KINDSandParsedTypesConfig.declarationKind.BaseTypesVisitor'sNamedType,ListType,FieldDefinition,InputValueDefinitionandUnionTypeDefinitionhave typed visitor params(
keyandparentare required, since the visitor always passes them), andObjectTypeDefinition,EnumTypeDefinitionandDirectiveDefinitionmay returnnull.@graphql-codegen/typescript: skips document files without adocumentwhen collectingintrospection types, types the
TsVisitorvisitor params, andTsVisitor.EnumTypeDefinitionmay return
nulllike the introspection visitor's override.Generated output is unchanged.
Updated dependencies
[
43d0f65,82ebbb5,eae0e62,1f7566f,7a376ef,3caccd3,ccc0d5c]:dotansimha/graphql-code-generator (@graphql-codegen/visitor-plugin-common)
v7.2.8Compare Source
Patch Changes
#11009
1f7566fThanks @eddeee888! - Fix type errors in
typescript-operationsunder
strict: trueby widening the shared types it calls into:@graphql-codegen/plugin-helpers:Types.ComplexPluginOutput'sprependandappendnowaccept
nullitems. Core already skipped them.@graphql-codegen/visitor-plugin-common:DeclarationBlock.withCommentacceptsundefined,parseEnumValues'smapOrStris optional (it already defaulted to{}),ImportSource.namespaceacceptsnull, andoptimizeOperations'sincludeFragmentsisoptional.
@graphql-codegen/typescript-operations: skips document files without adocument, and nolonger throws when called without the plugin info argument.
Generated output is unchanged.
#11014
7a376efThanks @eddeee888! - Fix type errors in
typescriptunderstrict: trueby typing the shared visitor methods it overrides:@graphql-codegen/visitor-plugin-common: addsNormalizedDeclarationKindConfig(everydeclaration kind set), used by
normalizeDeclarationKind,DEFAULT_DECLARATION_KINDSandParsedTypesConfig.declarationKind.BaseTypesVisitor'sNamedType,ListType,FieldDefinition,InputValueDefinitionandUnionTypeDefinitionhave typed visitor params(
keyandparentare required, since the visitor always passes them), andObjectTypeDefinition,EnumTypeDefinitionandDirectiveDefinitionmay returnnull.@graphql-codegen/typescript: skips document files without adocumentwhen collectingintrospection types, types the
TsVisitorvisitor params, andTsVisitor.EnumTypeDefinitionmay return
nulllike the introspection visitor's override.Generated output is unchanged.
#11031
3caccd3Thanks @eddeee888! - Fix type errors in
visitor-plugin-common(
selection-set-to-object,client-side-base-visitorandbase-documents-visitor) understrict: true:BaseDocumentsVisitor._selectionSetToObjectis optional, since it is only set bysetSelectionSetHandler.FragmentDefinitionandOperationDefinitionthrow a descriptiveerror when it is not set, and
FragmentDefinitionthrows one when the fragment's type conditionis not in the schema.
BaseDocumentsVisitor.FragmentDefinitionmay returnnull, which it already returns whengenerateOperationTypesisfalse.ClientSideBaseVisitor.buildOperationmay returnnull, which its base implementation alreadyreturns.
SelectionSetToObject.transformSelectionSetdeclares its return type, and throws a descriptiveerror when the instance has no selection set.
LinkField'saliasis optional, matching the link fields built for fields without an alias.BaseSelectionSetProcessor.typeCacheis keyed byLocation | undefined, since selection setsparsed with
noLocationhave noloc.getPossibleTypesaccepts anyGraphQLTypeorundefined, which it already handles byunwrapping 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.transformacceptsundefined, which it already handles byreturning
null.Generated output is unchanged.
#11030
ccc0d5cThanks @eddeee888! - Fix type errors in
visitor-plugin-common(
base-resolvers-visitor) understrict: true:BaseResolversVisitor's constructor takesadditionalConfigasPartial<TPluginConfig>, sincethe visitor fills in the defaults for every key it leaves out.
BaseResolversVisitor'sScalarTypeDefinition,DirectiveDefinitionandEnumTypeDefinitionmay return
null, which they already return for skipped federation scalars and directives andfor enums without
mappersorenumValues.BaseResolversVisitor.getAbstractMembersType'sisTypenameNonOptionalis optional, matchingthe optional
resolversNonOptionalTypenameflags it is read from.BaseResolversVisitor.defaultMapperTypethrows a descriptive error when thedefaultMapperconfig is not set.
Generated output is unchanged.
Updated dependencies
[
43d0f65,82ebbb5,eae0e62,1f7566f]:Configuration
📅 Schedule: (in timezone Asia/Tokyo)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR was generated by Mend Renovate. View the repository job log.