-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
keep-openTells Stale Bot to keep PRs and issues openTells Stale Bot to keep PRs and issues open
Description
Describe the bug
GraphqlJava validation SubscriptionUniqueRootField is not returning error of multiple root fields when there are multiple fields inside root inline fragment with no TypeCondition nor Directive.
To Reproduce
Test case on SubscriptionUniqueRootFieldTest
def "subscription with multiple root fields within inline fragment are not allowed"() {
given:
def subscriptionOneRootWithFragment = '''
subscription doggo {
... {
dog {
name
}
cat {
name
}
}
}
'''
when:
def validationErrors = validate(subscriptionOneRootWithFragment)
then:
!validationErrors.empty
validationErrors.size() == 1
validationErrors[0].validationErrorType == ValidationErrorType.SubscriptionMultipleRootFields
validationErrors[0].message == "Validation error (SubscriptionMultipleRootFields) : Subscription operation 'doggo' must have exactly one root field"
}
same for multiple inline fragments:
def subscriptionOneRootWithFragment = '''
subscription doggo {
... {
...{
dog {
name
}
cat {
name
}
}
}
}
'''
Metadata
Metadata
Assignees
Labels
keep-openTells Stale Bot to keep PRs and issues openTells Stale Bot to keep PRs and issues open