@@ -7,25 +7,25 @@ import spock.lang.Specification
7
7
8
8
class NoErrorPropagationTest extends Specification {
9
9
10
- def " with nullOnNonNullError , null is returned" () {
10
+ def " with nullOnError , null is returned" () {
11
11
12
12
def sdl = '''
13
13
type Query {
14
14
foo : Int!
15
15
}
16
- directive @nullOnNonNullError on QUERY | MUTATION | SUBSCRIPTION
16
+ directive @nullOnError on QUERY | MUTATION | SUBSCRIPTION
17
17
'''
18
18
19
19
def graphql = TestUtil . graphQL(sdl). build()
20
20
21
21
def query = '''
22
- query GetFoo @nullOnNonNullError { foo }
22
+ query GetFoo @nullOnError { foo }
23
23
'''
24
24
when :
25
25
26
26
ExecutionInput ei = ExecutionInput . newExecutionInput(query). root(
27
27
[foo : null ]
28
- ). graphQLContext([(ExperimentalApi . ENABLE_NULL_ON_NON_NULL_ERROR ): true ])
28
+ ). graphQLContext([(ExperimentalApi . ENABLE_NULL_ON_ERROR ): true ])
29
29
.build()
30
30
31
31
def er = graphql. execute(ei)
@@ -36,13 +36,13 @@ class NoErrorPropagationTest extends Specification {
36
36
er. errors[0 ]. path. toList() == [" foo" ]
37
37
}
38
38
39
- def " without nullOnNonNullError , error is propagated" () {
39
+ def " without nullOnError , error is propagated" () {
40
40
41
41
def sdl = '''
42
42
type Query {
43
43
foo : Int!
44
44
}
45
- directive @nullOnNonNullError on QUERY | MUTATION | SUBSCRIPTION
45
+ directive @nullOnError on QUERY | MUTATION | SUBSCRIPTION
46
46
'''
47
47
48
48
def graphql = TestUtil . graphQL(sdl). build()
@@ -54,7 +54,7 @@ class NoErrorPropagationTest extends Specification {
54
54
55
55
ExecutionInput ei = ExecutionInput . newExecutionInput(query). root(
56
56
[foo : null ]
57
- ). graphQLContext([(ExperimentalApi . ENABLE_NULL_ON_NON_NULL_ERROR ): true ])
57
+ ). graphQLContext([(ExperimentalApi . ENABLE_NULL_ON_ERROR ): true ])
58
58
.build()
59
59
60
60
def er = graphql. execute(ei)
@@ -66,19 +66,19 @@ class NoErrorPropagationTest extends Specification {
66
66
}
67
67
68
68
69
- def " when ENABLE_NULL_ON_NON_NULL_ERROR is false, error is propagated" () {
69
+ def " when ENABLE_NULL_ON_ERROR is false, error is propagated" () {
70
70
71
71
def sdl = '''
72
72
type Query {
73
73
foo : Int!
74
74
}
75
- directive @nullOnNonNullError on QUERY | MUTATION | SUBSCRIPTION
75
+ directive @nullOnError on QUERY | MUTATION | SUBSCRIPTION
76
76
'''
77
77
78
78
def graphql = TestUtil . graphQL(sdl). build()
79
79
80
80
def query = '''
81
- query GetFoo @nullOnNonNullError { foo }
81
+ query GetFoo @nullOnError { foo }
82
82
'''
83
83
when :
84
84
@@ -93,7 +93,7 @@ class NoErrorPropagationTest extends Specification {
93
93
er. errors[0 ]. path. toList() == [" foo" ]
94
94
}
95
95
96
- def " when @nullOnNonNullError is not added to the schema operation does not validate" () {
96
+ def " when @nullOnError is not added to the schema operation does not validate" () {
97
97
98
98
def sdl = '''
99
99
type Query {
@@ -104,20 +104,20 @@ class NoErrorPropagationTest extends Specification {
104
104
def graphql = TestUtil . graphQL(sdl). build()
105
105
106
106
def query = '''
107
- query GetFoo @nullOnNonNullError { foo }
107
+ query GetFoo @nullOnError { foo }
108
108
'''
109
109
when :
110
110
111
111
ExecutionInput ei = ExecutionInput . newExecutionInput(query). root(
112
112
[foo : null ]
113
- ). graphQLContext([(ExperimentalApi . ENABLE_NULL_ON_NON_NULL_ERROR ): true ])
113
+ ). graphQLContext([(ExperimentalApi . ENABLE_NULL_ON_ERROR ): true ])
114
114
.build()
115
115
116
116
def er = graphql. execute(ei)
117
117
118
118
then :
119
119
er. data == null
120
- er. errors[0 ]. message. equals(" Validation error (UnknownDirective) : Unknown directive 'nullOnNonNullError '" )
120
+ er. errors[0 ]. message. equals(" Validation error (UnknownDirective) : Unknown directive 'nullOnError '" )
121
121
}
122
122
123
123
}
0 commit comments