You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to enforce a global error handler across all our graphql mutations and queries so as to apply specific business logic before the error reaches the client.
So far I have only come up with the kadirahq/graphql-errors package, which basically walks all the fields of all the type definitions and wraps the resolve method of each one.
Is that what we only have today? Am I missing something? Would you consider adding such a feature, a global error handler?
The text was updated successfully, but these errors were encountered:
There are a couple of issues on this project to explore different error handling. See #284#402
I'm not completely sure what types of business logic you're talking about applying but the formatError option in express-graphql will catch and aggregate errors thrown during resolution. You can use that function to log or format before they reach the client.
This is already possible! Thanks @baer for some pointers to how you can implement this.
Since this package does not deal with sending results to a client, then the expectation is that you would place any post-processing between the output of any calls to this package and before serializing and sending to a client.
Hello,
We want to enforce a global error handler across all our graphql mutations and queries so as to apply specific business logic before the error reaches the client.
So far I have only come up with the kadirahq/graphql-errors package, which basically walks all the fields of all the type definitions and wraps the
resolve
method of each one.Is that what we only have today? Am I missing something? Would you consider adding such a feature, a global error handler?
The text was updated successfully, but these errors were encountered: