Create custom GraphQL/Apollo errors to throw to clients
Opened this issue · 0 comments
dfernandezm commented
In resolverMap.ts
, handleErrors
:
//TODO: these errors contain lots of information in stacktrace, should be cut to minimum information
// https://www.apollographql.com/docs/apollo-server/data/errors/#custom-errors
- Stacktraces should be logged only on server and not sent to clients
- Have a handler that deals with custom errors sending specific codes for known ones
- Basic e2e test / unit test
- Manage in a single place the ErrorCodes, handleErrors, and custom errors thrown