From bf588d372c0078378aaa24beea2da794af7949e6 Mon Sep 17 00:00:00 2001 From: Valentin Cocaud Date: Wed, 9 Oct 2024 08:45:12 +0200 Subject: [PATCH] [legacy] allow for non string values in additionalArgs (#7719) * [legacy] allow for non string values in additionalArgs * changeset --- .changeset/fair-students-tease.md | 5 +++++ packages/legacy/utils/src/resolve-additional-resolvers.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/fair-students-tease.md diff --git a/.changeset/fair-students-tease.md b/.changeset/fair-students-tease.md new file mode 100644 index 0000000000000..37b1b1982691a --- /dev/null +++ b/.changeset/fair-students-tease.md @@ -0,0 +1,5 @@ +--- +'@graphql-mesh/utils': patch +--- + +Allow for static values in `additionalArgs` instead of only interpolated strings. diff --git a/packages/legacy/utils/src/resolve-additional-resolvers.ts b/packages/legacy/utils/src/resolve-additional-resolvers.ts index a2f78191f5f5a..a6ebd2c8c5f88 100644 --- a/packages/legacy/utils/src/resolve-additional-resolvers.ts +++ b/packages/legacy/utils/src/resolve-additional-resolvers.ts @@ -199,10 +199,11 @@ export function resolveAdditionalResolversWithoutImport( const resolverData = { root, args, context, info, env: process.env }; const targetArgs: any = {}; for (const argPath in additionalResolver.additionalArgs || {}) { + const value = additionalResolver.additionalArgs[argPath]; dset( targetArgs, argPath, - stringInterpolator.parse(additionalResolver.additionalArgs[argPath], resolverData), + typeof value === 'string' ? stringInterpolator.parse(value, resolverData) : value, ); } const options: any = {