-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix triple nested enum validation error #2570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix triple nested enum validation error #2570
Conversation
# Conflicts: # src/test/groovy/graphql/execution/ValuesResolverTest.groovy
| } else { | ||
| Object coercedValue = externalValueToInternalValue(fieldVisibility, variableType, value); | ||
| coercedValues.put(variableName, coercedValue); | ||
| try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fundamental change is to move the CoercingParseValueException catch one function earlier in the chain, to externalValueToInternalValueForVariables.
Although it appears many lines are changing, it's mostly only indentation for the try catch block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rationale for moving the catch: the source location is available here, whereas it is not passed down to the next function externalValueToInternalValue.
| executionResult.data == null | ||
| executionResult.errors.size() == 1 | ||
| executionResult.errors[0].errorType == ErrorType.ValidationError | ||
| executionResult.errors[0].message == 'Variable \'input\' has an invalid value: Invalid input for Enum \'PositionType\'. No value found for name \'UNKNOWN_POSITION\'' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record - Groovy has 4 types of comments
' single quotes '
" double quotes "
""" triple double quotes """
''' triple single quotes '''
if you find yourself using `'input' - just swap quotes
This PR addresses #2560 and improves exception messaging for
CoercingParseValueException.invalid error: