Skip to content

Commit 7675da7

Browse files
committed
graphql-java#489 schema problem has message now
1 parent 55c5723 commit 7675da7

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/main/java/graphql/schema/idl/errors/SchemaProblem.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ public SchemaProblem(List<GraphQLError> errors) {
2020
this.errors = new ArrayList<>(errors);
2121
}
2222

23+
@Override
24+
public String getMessage() {
25+
return "errors=" + errors;
26+
}
27+
2328
public List<GraphQLError> getErrors() {
2429
return errors;
2530
}

src/test/groovy/graphql/schema/idl/SchemaParserTest.groovy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ class SchemaParserTest extends Specification {
136136
read(spec)
137137

138138
then:
139-
140-
thrown(SchemaProblem)
139+
def schemaProblem = thrown(SchemaProblem)
140+
schemaProblem.getMessage().contains("InvalidSyntaxError")
141+
schemaProblem.getErrors().size() == 1
141142
}
142143

143144
def "schema with union"() {

0 commit comments

Comments
 (0)