Skip to content

Commit

Permalink
fix typo with fragment variable values (#4239)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacovCR authored Oct 15, 2024
1 parent 0767861 commit 89a0b63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/execution/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ function getStreamUsage(
(fieldDetails) => ({
node: fieldDetails.node,
deferUsage: undefined,
fragmentVariablesValues: fieldDetails.fragmentVariableValues,
fragmentVariableValues: fieldDetails.fragmentVariableValues,
}),
);

Expand Down
10 changes: 4 additions & 6 deletions src/execution/values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export function experimentalGetArgumentValues(
node: FieldNode | DirectiveNode | FragmentSpreadNode,
argDefs: ReadonlyArray<GraphQLArgument | GraphQLVariableSignature>,
variableValues: Maybe<VariableValues>,
fragmentVariablesValues?: Maybe<VariableValues>,
fragmentVariableValues?: Maybe<VariableValues>,
hideSuggestions?: Maybe<boolean>,
): { [argument: string]: unknown } {
const coercedValues: { [argument: string]: unknown } = {};
Expand Down Expand Up @@ -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 ||
Expand Down Expand Up @@ -293,7 +291,7 @@ export function experimentalGetArgumentValues(
valueNode,
argType,
variableValues,
fragmentVariablesValues,
fragmentVariableValues,
hideSuggestions,
);
if (coercedValue === undefined) {
Expand Down

0 comments on commit 89a0b63

Please sign in to comment.