-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathIssue743.groovy
More file actions
33 lines (26 loc) · 994 Bytes
/
Issue743.groovy
File metadata and controls
33 lines (26 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package graphql
import spock.lang.Specification
class Issue743 extends Specification {
def "#743 missing variables"() {
when:
def graphQL = TestUtil.graphQL("""
type Query {
version : Int
}
""").build()
def executionInput = ExecutionInput.newExecutionInput()
.query('''
query NPEDueToMissingVariable($isTrue: Boolean!) {
version @include(if: $isTrue)
}
''')
.variables([:])
.build()
def executionResult = graphQL.execute(executionInput)
then:
executionResult.data == null
executionResult.errors.size() == 1
executionResult.errors[0].errorType == ErrorType.ValidationError
executionResult.errors[0].message == "Variable 'isTrue' has an invalid value: Variable 'isTrue' has coerced Null value for NonNull type 'Boolean!'"
}
}