graphql-client
graphql-client copied to clipboard
Further fixes on pull #2
Nice. I'll take a look at it and get back to you soon
Hm, what happend with the error handling part after query result. When a query returns with errors i wanted it to throw to the catch block so the promise chain stops
In my API I'm throwing custom errors that I need to display in the HTML. So I need to get the response as is, regardless of whether it's an error or not. And since GraphQL is so "strong typed" I cannot return { error: 'Error ...' }
from a resolver when the schema expects something like { foo: String! }
. But it is possible to throw from within a 'data' hook if anyone needs so
I also removed everything regarding of how errors should be treated (e.g. useful debugging info), since now everything could be done inside of hooks. So I guess it would be better to move such things apart to different modules and attach them using hooks