Describe the bug
Currently when a resolver thrown an error, it will use that operation's Response status code to send back a GraphQLResult with the thrown error, but leave out all other things set on it (i.e. headers, cookies, etc.).
It should not make the decision that an error meant the headers, cookies should not be set, and instead use the Response and all its values to encode the GraphQLResult with the error message.
Steps to reproduce
Have a resolver that throw an error after settings values in the response header.
Run the server and make a request with the GraphQL query of:
mutation {
doSomething
}
It should return a JSON of GraphQLResult with an empty data field and errors field with the thrown error (formatted as GraphQLError), but it will not send back any headers.
Describe the bug Currently when a resolver thrown an error, it will use that operation's Response status code to send back a GraphQLResult with the thrown error, but leave out all other things set on it (i.e. headers, cookies, etc.).
It should not make the decision that an error meant the headers, cookies should not be set, and instead use the Response and all its values to encode the GraphQLResult with the error message.
Steps to reproduce
Have a resolver that throw an error after settings values in the response header.
Have the schema with this as mutation or query, so it can run on HTTP
Run the server and make a request with the GraphQL query of:
It should return a JSON of GraphQLResult with an empty
data
field anderrors
field with the thrown error (formatted as GraphQLError), but it will not send back any headers.