Skip to content

Commit d7d29b2

Browse files
committed
Fixed bad operation exception so that it does not escape - extra test fix up
1 parent bcfe719 commit d7d29b2

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/test/groovy/graphql/GraphQLTest.groovy

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ class GraphQLTest extends Specification {
327327
result.errors.size() == 0
328328
}
329329

330-
def "document with two operations but no specified operation throws"() {
330+
def "document with two operations but no specified operation does not throw"() {
331331
given:
332332

333333
GraphQLSchema schema = newSchema().query(
@@ -343,10 +343,12 @@ class GraphQLTest extends Specification {
343343
"""
344344

345345
when:
346-
GraphQL.newGraphQL(schema).build().execute(query)
346+
def er = GraphQL.newGraphQL(schema).build().execute(query)
347347

348348
then:
349-
thrown(GraphQLException)
349+
noExceptionThrown()
350+
!er.errors.isEmpty()
351+
er.errors[0].message.contains("Must provide operation name if query contains multiple operations")
350352
}
351353

352354
def "null mutation type does not throw an npe but returns and error"() {

0 commit comments

Comments
 (0)