Skip to content

Commit 05a52ea

Browse files
committed
Keep lazy coercion regression tests out of PR 4507
1 parent 5a89318 commit 05a52ea

1 file changed

Lines changed: 0 additions & 36 deletions

File tree

‎src/test/groovy/graphql/execution/ValuesResolverNullabilityTest.groovy‎

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import graphql.GraphQL
88
import graphql.ParseAndValidate
99
import graphql.TestUtil
1010
import graphql.schema.DataFetcher
11-
import spock.lang.PendingFeature
1211
import spock.lang.Specification
1312

1413
class ValuesResolverNullabilityTest extends Specification {
@@ -154,41 +153,6 @@ class ValuesResolverNullabilityTest extends Specification {
154153
'mutation' | 'String!'
155154
}
156155

157-
@PendingFeature(exceptions = [], reason = 'Argument coercion is lazy: invalid arguments can reach a resolver or be ignored entirely. This execution limitation predates PR #4507.')
158-
def "invalid arguments must prevent #operation resolver invocation with #argumentType and readsArguments=#readsArguments"() {
159-
given:
160-
int calls = 0
161-
DataFetcher fetcher = { env ->
162-
calls++
163-
if (readsArguments) {
164-
env.getArgument('arg')
165-
}
166-
'unexpected'
167-
}
168-
def graphQL = buildGraphQL(argumentType, fetcher)
169-
def query = operation + '($v: String = "x") { f(arg: ' + literal + ') }'
170-
171-
when:
172-
def result = executeValid(graphQL, query, [v: null])
173-
174-
then:
175-
calls == 0
176-
result.data == [f: null]
177-
result.errors.size() == 1
178-
result.errors[0].path == ['f']
179-
180-
where:
181-
operation | argumentType | literal | readsArguments
182-
'query' | '[String!]!' | '[$v]' | false
183-
'query' | '[String!]!' | '[$v]' | true
184-
'query' | 'RequiredInput' | '{a: $v}' | false
185-
'query' | 'RequiredInput' | '{a: $v}' | true
186-
'mutation' | '[String!]!' | '[$v]' | false
187-
'mutation' | '[String!]!' | '[$v]' | true
188-
'mutation' | 'RequiredInput' | '{a: $v}' | false
189-
'mutation' | 'RequiredInput' | '{a: $v}' | true
190-
}
191-
192156
private GraphQL buildGraphQL(String argumentType, DataFetcher fetcher, String resultType = 'String') {
193157
def sdl = """
194158
input RequiredInput { a: String! }

0 commit comments

Comments
 (0)