I'd like to update my http status code for all my graphql requests to mirror the nested status code in the graphql error response.
For example, here's the response I'd get back if a request has an invalid auth token. I'm trying to make the http status code also a 401, not a 200. I'm using express and apollo as the drivers
{
"errors": [
{
"message": "Unauthorized",
"locations": [
{
"line": 1,
"column": 7
}
],
"path": [
"teeTimes"
],
"extensions": {
"code": "UNAUTHENTICATED",
"originalError": {
"message": "Unauthorized",
"statusCode": 401
}
}
}
],
"data": null
}