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
First of all thanks for putting all the effort into this library.
What is the correct way to represent errors that belong to my application, not GraphQL related? Stuff like Email already exists in a signup mutation, or validation errors like Name should contain at least 2 characters?
Also, if you are looking for contributors, I would be happy to help. It would be nice to start tackling some easy stuff first and then grow to bigger problems.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi, this is a very good question, albeit mostly unrelated to the library IMHO.
You pointed out already that there is a natural distinction between domain errors and technical errors. We made good experience by modeling domain errors in the Graph itself. Clients usually want to display those in some form to the user whichis is rather tedious if you have to extract those from the errors field in the GraphQL response.
How you actually model it is up to you but I think you want to have the following properties:
if the mutation failed with a domain error you want to stop execution at that level
you likely want typed errors
if all went well you want to just continue traversing the graph
Error representation is still one of the weak spots in GraphQL. So what I said is not a „standard“ way of doing things but rather the learnings me and my team have after having built, evolved and operated our GraphQL gateway in production for the last ~2years. We actually don’t use unions but specialised execution that is turned on with directives but the underlying idea remains the same.
First of all thanks for putting all the effort into this library.
What is the correct way to represent errors that belong to my application, not GraphQL related? Stuff like
Email already exists
in asignup
mutation, or validation errors likeName should contain at least 2 characters
?Also, if you are looking for contributors, I would be happy to help. It would be nice to start tackling some easy stuff first and then grow to bigger problems.
Thanks!
The text was updated successfully, but these errors were encountered: