Skip to content

Commit

Permalink
[legacy] allow for non string values in additionalArgs (#7719)
Browse files Browse the repository at this point in the history
* [legacy] allow for non string values in additionalArgs

* changeset
  • Loading branch information
EmrysMyrddin authored Oct 9, 2024
1 parent cbdf8e7 commit bf588d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fair-students-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-mesh/utils': patch
---

Allow for static values in `additionalArgs` instead of only interpolated strings.
3 changes: 2 additions & 1 deletion packages/legacy/utils/src/resolve-additional-resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit bf588d3

Please sign in to comment.