Skip to content

Conversation

martinbonnin
Copy link
Contributor

@martinbonnin martinbonnin commented Feb 17, 2022

is GQLNonNullType -> type.canInputValueBeAssignedTo(target.type)
is GQLListType -> type.canInputValueBeAssignedTo(target)
is GQLNamedType -> type.canInputValueBeAssignedTo(target)
internal fun isVariableUsageAllowed(variableDefinition: GQLVariableDefinition, usage: VariableUsage): Boolean {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a lot of shuffling around to match better with the spec terminology and algorithm

Copy link
Contributor

@BoD BoD left a comment

Choose a reason for hiding this comment

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

💪


if (locationType is GQLNonNullType && variableType !is GQLNonNullType) {
if (variableDefinition.defaultValue == null && !usage.hasLocationDefaultValue) {
return false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the actual fix

@martinbonnin martinbonnin merged commit ddf5db7 into main Feb 17, 2022
@martinbonnin martinbonnin deleted the allow-nullable-variables-in-nonnull-locations branch February 17, 2022 16:23
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.

Allows nullable variables in non-null locations
2 participants