Closed andyjac closed 2 years ago
See https://github.com/distributeaid/shipment-tracker/blob/84ea3d61a049c243eb26c027c4afdba0bdff8c90/src/resolvers/input-validation/errorsToProblemDetails.ts#L6-L40 for a way to express API errors.
IMO ApolloError schould not be used for internal error, instead EntityNotFound which then is wrapped into problem details.
In the end it depends on how the frontend would like to present errors.
This has been added to the REST API: 93a304ae13807cc980ccd4c8c1eb052a51d0692e
1. Dig into graphql errors types and what they mean/best practices around using them
ApolloError
be used?2. Deduplicate error logic
At the moment we have string literals floating around in various places for error messages. We should:
Shipment not found
orShipment does not exist
?)