From c7b1fcaf7b465e240ba563adf7d0b4fac2c1712f Mon Sep 17 00:00:00 2001 From: Suhun Han Date: Wed, 19 Jun 2024 13:43:18 +0900 Subject: [PATCH] fix(graphql): ensure scalarsMap in buildSchemaOptions is respected The scalarsMap in buildSchemaOptions was not used even though it's defined. This change ensures that the scalarsMap is correctly merged and respected in the buildSchemaOptions. --- packages/graphql/lib/graphql-schema.builder.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/graphql/lib/graphql-schema.builder.ts b/packages/graphql/lib/graphql-schema.builder.ts index 557dfc136..d06341821 100644 --- a/packages/graphql/lib/graphql-schema.builder.ts +++ b/packages/graphql/lib/graphql-schema.builder.ts @@ -31,7 +31,10 @@ export class GraphQLSchemaBuilder { autoSchemaFile, { ...buildSchemaOptions, - scalarsMap, + scalarsMap: [ + ...(buildSchemaOptions.scalarsMap ?? []), + ...scalarsMap.filter(({ type }) => buildSchemaOptions.scalarsMap?.every((item) => item.type !== type) ?? true), + ], }, options.sortSchema, options.transformAutoSchemaFile && options.transformSchema,