Closed Kalyan457 closed 4 months ago
Do you have any more details on what the specific error is or how to reproduce it? I can see that the path can be null, but it appears that when the ExecutionResult
is serialized by first calling toSpecification
, null values such as path are just not included in the response map at all. Is your request going against a DGS service or some other GraphQL service that returns an explicit null for path?
We use AWS AppSync and it explicitly returns null
for path if the received request doesn't obey GraphQL schema.
I see, thanks for the context. I think the gap is here due graphql-java's behavior of simply skipping null fields in the response. e.g., your example would be more like this if serialized by graphql-java:
{
"errors": [
{
"locations": [
{
"line": 2,
"column": 26
}
],
"message": "Validation error....is missing required fields...."
}
]
}
I have a PR open that doesn't change the fields to nullable, but allows your response to be deserialized nonetheless; switching it to be nullable would have some compatibility concerns, so just allowing it to deserialize is a safer approach. For instance, we would deserialize an explicit null path and a missing path property the same, as an empty list. I am struggling to think of a case where the distinction would matter from the client's perspective. Does that work for you?
Yes. This works for me! Thanks! Do you know in which version this would be released?
@Kalyan457 we should be able to cut a bug fix release this week.
This was released in v8.4.0
Expected behavior
GraphQLError should be successfully deserialized when the
path
parameter is null.Actual behavior
Steps to reproduce
GraphQLClient.executeQuery()
.path
parameter tonull
. When this is deserialized asGraphQLError
, it throws the above mentioned exception.It would be ideal if
path
parameter is nullable