Skip to content

Commit

Permalink
final polishes?
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacovCR committed Oct 18, 2024
1 parent 44cce56 commit 6c2cde6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/execution/values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ export function experimentalGetArgumentValues(
? fragmentVariableValues
: variableValues;
if (
scopedVariableValues?.coerced[variableName] === undefined &&
(scopedVariableValues == null ||
!Object.hasOwn(scopedVariableValues.coerced, variableName)) &&
!isRequiredArgument(argDef)
) {
if (argDef.defaultValue) {
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/coerceInputValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export function coerceInputLiteral(

const leafType = assertLeafType(type);
try {
return leafType.coerceInputLiteral !== undefined
return leafType.coerceInputLiteral
? leafType.coerceInputLiteral(
replaceVariables(valueNode, variableValues, fragmentVariableValues),
)
Expand Down
10 changes: 3 additions & 7 deletions src/utilities/validateInputValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,13 +455,9 @@ function validateInputLiteralImpl(
let result;
let caughtError;
try {
result =
type.coerceInputLiteral !== undefined
? type.coerceInputLiteral(
replaceVariables(valueNode),
hideSuggestions,
)
: type.parseLiteral(valueNode, undefined, hideSuggestions);
result = type.coerceInputLiteral
? type.coerceInputLiteral(replaceVariables(valueNode), hideSuggestions)
: type.parseLiteral(valueNode, undefined, hideSuggestions);
} catch (error) {
if (error instanceof GraphQLError) {
context.onError(error, pathToArray(path));
Expand Down

0 comments on commit 6c2cde6

Please sign in to comment.