File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
core/src/main/kotlin/org/neo4j/graphql Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 1
1
package org.neo4j.graphql
2
2
3
- import graphql.ExceptionWhileDataFetching
4
- import graphql.ExecutionInput
5
- import graphql.GraphQL
6
- import graphql.InvalidSyntaxError
3
+ import graphql.*
4
+ import graphql.execution.NonNullableFieldWasNullError
7
5
import graphql.schema.GraphQLSchema
8
- import graphql.validation.ValidationError
9
6
10
7
class Translator (val schema : GraphQLSchema ) {
11
8
@@ -27,8 +24,15 @@ class Translator(val schema: GraphQLSchema) {
27
24
result.errors?.forEach {
28
25
when (it) {
29
26
is ExceptionWhileDataFetching -> throw it.exception
30
- is ValidationError -> throw InvalidQueryException (it)
31
- is InvalidSyntaxError -> throw InvalidQueryException (it)
27
+
28
+ is TypeMismatchError , // expected since we return cypher here instead of the correct json
29
+ is NonNullableFieldWasNullError , // expected since the returned cypher does not match the shape of the graphql type
30
+ is SerializationError // expected since the returned cypher does not match the shape of the graphql type
31
+ -> {
32
+ // ignore
33
+ }
34
+ // generic error handling
35
+ is GraphQLError -> throw InvalidQueryException (it)
32
36
}
33
37
}
34
38
You can’t perform that action at this time.
0 commit comments