@@ -7,25 +7,25 @@ import spock.lang.Specification
77
88class NoErrorPropagationTest extends Specification {
99
10- def " with nullOnNonNullError , null is returned" () {
10+ def " with nullOnError , null is returned" () {
1111
1212 def sdl = '''
1313 type Query {
1414 foo : Int!
1515 }
16- directive @nullOnNonNullError on QUERY | MUTATION | SUBSCRIPTION
16+ directive @nullOnError on QUERY | MUTATION | SUBSCRIPTION
1717 '''
1818
1919 def graphql = TestUtil . graphQL(sdl). build()
2020
2121 def query = '''
22- query GetFoo @nullOnNonNullError { foo }
22+ query GetFoo @nullOnError { foo }
2323 '''
2424 when :
2525
2626 ExecutionInput ei = ExecutionInput . newExecutionInput(query). root(
2727 [foo : null ]
28- ). graphQLContext([(ExperimentalApi . ENABLE_NULL_ON_NON_NULL_ERROR ): true ])
28+ ). graphQLContext([(ExperimentalApi . ENABLE_NULL_ON_ERROR ): true ])
2929 .build()
3030
3131 def er = graphql. execute(ei)
@@ -36,13 +36,13 @@ class NoErrorPropagationTest extends Specification {
3636 er. errors[0 ]. path. toList() == [" foo" ]
3737 }
3838
39- def " without nullOnNonNullError , error is propagated" () {
39+ def " without nullOnError , error is propagated" () {
4040
4141 def sdl = '''
4242 type Query {
4343 foo : Int!
4444 }
45- directive @nullOnNonNullError on QUERY | MUTATION | SUBSCRIPTION
45+ directive @nullOnError on QUERY | MUTATION | SUBSCRIPTION
4646 '''
4747
4848 def graphql = TestUtil . graphQL(sdl). build()
@@ -54,7 +54,7 @@ class NoErrorPropagationTest extends Specification {
5454
5555 ExecutionInput ei = ExecutionInput . newExecutionInput(query). root(
5656 [foo : null ]
57- ). graphQLContext([(ExperimentalApi . ENABLE_NULL_ON_NON_NULL_ERROR ): true ])
57+ ). graphQLContext([(ExperimentalApi . ENABLE_NULL_ON_ERROR ): true ])
5858 .build()
5959
6060 def er = graphql. execute(ei)
@@ -66,19 +66,19 @@ class NoErrorPropagationTest extends Specification {
6666 }
6767
6868
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" () {
7070
7171 def sdl = '''
7272 type Query {
7373 foo : Int!
7474 }
75- directive @nullOnNonNullError on QUERY | MUTATION | SUBSCRIPTION
75+ directive @nullOnError on QUERY | MUTATION | SUBSCRIPTION
7676 '''
7777
7878 def graphql = TestUtil . graphQL(sdl). build()
7979
8080 def query = '''
81- query GetFoo @nullOnNonNullError { foo }
81+ query GetFoo @nullOnError { foo }
8282 '''
8383 when :
8484
@@ -93,7 +93,7 @@ class NoErrorPropagationTest extends Specification {
9393 er. errors[0 ]. path. toList() == [" foo" ]
9494 }
9595
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" () {
9797
9898 def sdl = '''
9999 type Query {
@@ -104,20 +104,20 @@ class NoErrorPropagationTest extends Specification {
104104 def graphql = TestUtil . graphQL(sdl). build()
105105
106106 def query = '''
107- query GetFoo @nullOnNonNullError { foo }
107+ query GetFoo @nullOnError { foo }
108108 '''
109109 when :
110110
111111 ExecutionInput ei = ExecutionInput . newExecutionInput(query). root(
112112 [foo : null ]
113- ). graphQLContext([(ExperimentalApi . ENABLE_NULL_ON_NON_NULL_ERROR ): true ])
113+ ). graphQLContext([(ExperimentalApi . ENABLE_NULL_ON_ERROR ): true ])
114114 .build()
115115
116116 def er = graphql. execute(ei)
117117
118118 then :
119119 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 '" )
121121 }
122122
123123}
0 commit comments