Skip to content

Commit

Permalink
don't even list a source value if there wasn't one, just like it's no…
Browse files Browse the repository at this point in the history
…t in the map
  • Loading branch information
yaacovCR committed Sep 25, 2024
1 parent 224ab1e commit 958681c
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/execution/values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface VariableValues {

interface VariableValueSource {
readonly signature: GraphQLVariableSignature;
readonly value: unknown;
readonly value?: unknown;
}

type VariableValuesOrErrors =
Expand Down Expand Up @@ -104,10 +104,7 @@ function coerceVariableValues(
if (!Object.hasOwn(inputs, varName)) {
const defaultValue = varSignature.defaultValue;
if (defaultValue) {
sources[varName] = {
signature: varSignature,
value: undefined,
};
sources[varName] = { signature: varSignature };
coerced[varName] = coerceDefaultValue(defaultValue, varType);
} else if (isNonNullType(varType)) {
const varTypeStr = inspect(varType);
Expand All @@ -118,10 +115,7 @@ function coerceVariableValues(
),
);
} else {
sources[varName] = {
signature: varSignature,
value: undefined,
};
sources[varName] = { signature: varSignature };
}
continue;
}
Expand Down Expand Up @@ -244,7 +238,9 @@ export function experimentalGetArgumentValues(

if (valueNode.kind === Kind.VARIABLE) {
const variableName = valueNode.name.value;
const scopedVariableValues = fragmentVariablesValues?.sources[variableName]
const scopedVariableValues = fragmentVariablesValues?.sources[
variableName
]
? fragmentVariablesValues
: variableValues;
if (
Expand Down

0 comments on commit 958681c

Please sign in to comment.