From 454310347e7717089ee27ad8181a15198a4df9e0 Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Tue, 15 Oct 2024 17:33:11 +0300 Subject: [PATCH] fix typo with fragment variable values (#4239) --- src/execution/execute.ts | 2 +- src/execution/values.ts | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/execution/execute.ts b/src/execution/execute.ts index be2be7d7..c6afc552 100644 --- a/src/execution/execute.ts +++ b/src/execution/execute.ts @@ -1145,7 +1145,7 @@ function getStreamUsage( (fieldDetails) => ({ node: fieldDetails.node, deferUsage: undefined, - fragmentVariablesValues: fieldDetails.fragmentVariableValues, + fragmentVariableValues: fieldDetails.fragmentVariableValues, }), ); diff --git a/src/execution/values.ts b/src/execution/values.ts index 77050858..395bce95 100644 --- a/src/execution/values.ts +++ b/src/execution/values.ts @@ -219,7 +219,7 @@ export function experimentalGetArgumentValues( node: FieldNode | DirectiveNode | FragmentSpreadNode, argDefs: ReadonlyArray, variableValues: Maybe, - fragmentVariablesValues?: Maybe, + fragmentVariableValues?: Maybe, hideSuggestions?: Maybe, ): { [argument: string]: unknown } { const coercedValues: { [argument: string]: unknown } = {}; @@ -254,10 +254,8 @@ export function experimentalGetArgumentValues( if (valueNode.kind === Kind.VARIABLE) { const variableName = valueNode.name.value; - const scopedVariableValues = fragmentVariablesValues?.sources[ - variableName - ] - ? fragmentVariablesValues + const scopedVariableValues = fragmentVariableValues?.sources[variableName] + ? fragmentVariableValues : variableValues; if ( scopedVariableValues == null || @@ -293,7 +291,7 @@ export function experimentalGetArgumentValues( valueNode, argType, variableValues, - fragmentVariablesValues, + fragmentVariableValues, hideSuggestions, ); if (coercedValue === undefined) {