maticzav / graphql-shield

๐Ÿ›ก A GraphQL tool to ease the creation of permission layer.

Home Page:https://graphql-shield.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

adding errors to GraphQLErrors array

RyanLinXiang opened this issue ยท comments

Hi there,

I am new to GraphQL and graphql-shield. Maybe I got something totally wrong - but when I throw an error inside a resolver, it should be added to the errors array returned by Apollo client (either useQuery or client.mutate, I am using the second). But instead I always arrive in the catch block:

try {
   const {data, errors } = const apolloClient.mutate(...);

   // I want to have the errors here
   } 
catch (e) {

   // why am I always arriving here?
}

I tried "allowExternalErrors: true" - but I am still arriving in the catch block.
Any idea?

BR,

Lin.

Hey @RyanLinXiang ๐Ÿ‘‹,

Thank you for opening an issue. We will get back to you as soon as we can. Have you seen our Open Collective page? Please consider contributing financially to our project. This will help us involve more contributors and get to issues like yours faster.

https://opencollective.com/graphql-shield

We offer priority support for all financial contributors. Don't forget to add priority label once you become one! ๐Ÿ˜„

Hmm that's an interesting problem, but I don't think it's caused by GraphQL Shield. Maybe if you compose a small reproduction CodeSandbox I can take a look at it. ๐Ÿ™‚

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.