Skip to content

Fix for coerceVariableValues#2083

Merged
bbakerman merged 1 commit into
graphql-java:masterfrom
dugenkui03:patch-18
Nov 10, 2020
Merged

Fix for coerceVariableValues#2083
bbakerman merged 1 commit into
graphql-java:masterfrom
dugenkui03:patch-18

Conversation

@dugenkui03

@dugenkui03 dugenkui03 commented Oct 27, 2020

Copy link
Copy Markdown
Contributor

Fix for coerceVariableValues to ensure that:

  1. use null when variable defined in variableValuesMap is null;
  2. if variableType is a Non‐Nullable type and value is null, throw a query error.

Linkage to algorithm defined in spec


private Object getVariableValue(GraphqlFieldVisibility fieldVisibility, VariableDefinition variableDefinition, GraphQLType variableType, Object value) {

if (value == null && variableDefinition.getDefaultValue() != null) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use null when variable defined in variableValuesMap is null

@bbakerman bbakerman added this to the 16.0 milestone Nov 10, 2020
@bbakerman bbakerman merged commit 39c567e into graphql-java:master Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants