apollo-link icon indicating copy to clipboard operation
apollo-link copied to clipboard

Apollo link error modify error returned in components

Open sami616 opened this issue 6 years ago • 1 comments

Is there anyway for me to modify the shape of the errors which are passed to my components using apollo-link-error?

I tried manually setting the response.error object but didn't have any luck.

Is this possible?

sami616 avatar May 17 '19 16:05 sami616

Same issue here. I want to wrap the error object into an Error instance before forwarding (just like Afterware (data manipulation)) to the component but it doesn't work.

return forward(operation).map((response) => {
  if (response.errors) {
    response.data = new BaseError(graphQLErrors);
  }
  return response;
});

sontd-0882 avatar Jan 06 '20 06:01 sontd-0882