graphql-client icon indicating copy to clipboard operation
graphql-client copied to clipboard

Further fixes on pull #2

Open ilearnio opened this issue 8 years ago • 4 comments

ilearnio avatar Jul 27 '16 17:07 ilearnio

Nice. I'll take a look at it and get back to you soon

nordsimon avatar Jul 27 '16 17:07 nordsimon

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

nordsimon avatar Jul 27 '16 18:07 nordsimon

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

ilearnio avatar Jul 27 '16 19:07 ilearnio

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

ilearnio avatar Jul 27 '16 19:07 ilearnio