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 11package org.neo4j.graphql
22
3- import graphql.ExceptionWhileDataFetching
4- import graphql.ExecutionInput
5- import graphql.GraphQL
6- import graphql.InvalidSyntaxError
3+ import graphql.*
4+ import graphql.execution.NonNullableFieldWasNullError
75import graphql.schema.GraphQLSchema
8- import graphql.validation.ValidationError
96
107class Translator (val schema : GraphQLSchema ) {
118
@@ -27,8 +24,15 @@ class Translator(val schema: GraphQLSchema) {
2724 result.errors?.forEach {
2825 when (it) {
2926 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)
3236 }
3337 }
3438
You can’t perform that action at this time.
0 commit comments