mercurius: Incorrect Error object returned
Hello fastify team @RafaelGSS , the issue that i am seeing is when i run a query and receive an error it looks as follows:
{
"error": {
"data": null,
"errors": [
{
"message": "error message thrown",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"test"
]
}
]
}
}
however, if i run the same query again I see the error as below:
{
"data": null,
"errors": [
{
"message": "error message thrown",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"test"
]
}
]
}
Notice how there is an error object that wraps the actual error at first but then disappears with the cache of the error. The issue happens when using custom errors. is there a way to remove this error wrapping and have the library return the same error? Thank you so much for your help!! Here is the link to the open repo: https://github.com/paul590/toSendGraphQL
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 24 (9 by maintainers)
@paul590 would you like to send a PR to fix/improve this? It’s probably better for you to contribute back a fix rather than us trying to guess which implementation would match your needs.