-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explain errors as data #204
Comments
Any recommendations on this? |
How would you determine that the GraphQL response had errors? Would something like a boolean |
2016, 2017 and now 2018. Have we solved that already? |
2016, 2017, 2019 and near 2020 and counting... Today I've been reading how to improve the error handling of an existing API especially for user/expected errors. First, it was important to me the opinion of @leebyron about the default "error system" that it is intended for unexpected errors. Check it here The most recurrent flavors I read (besides using the default one) are: "Medium/Sasha Solomon Flavor": Valid also for queries, use a UNION with the normal result plus new types that represents all the possible expected errors like "UserDeleted". In this article both method are considered. IMO with the experience collected from all the community so far in late 2019, the handling of "user/expected errors" should be standardized in the GRAPHQL spec (with op-in for current apis) instead of modeled with the current artifacts and applying different approaches. |
As suggested in graphql/graphql-js#560
Sometimes errors are totally expected and deserve to be represented as data in an API. This is worth a best practices post
The text was updated successfully, but these errors were encountered: