Closed ziimakc closed 3 years ago
I'm not super familiar with Apollo, but I don't see why you would need formatError. You should be able to run execute
and do whatever you want with the result (log it, return it, etc). Are you talking about an http integration crate where you need hooks instead of juniper itself?
For the other issue you need your type to be send...display is not enough. I'd suggest using anyhow and thiserror as they can help you with the boilerplate.
In my opinion errors should never be send as is to client and possible leak some sensitive information.
Question 1: is there something like formatError in apollo that can be used to check if error was handled?
Question 2: following error handling example how can i log errors on backend? Doing something like this:
My attempt:
Give me some confusing error: