-
-
Notifications
You must be signed in to change notification settings - Fork 821
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
Implements GraphQL Error Handling: Resolver user #1489
Conversation
Our Pull Request Approval ProcessWe have these basic policies to make the approval process smoother for our volunteer team. Testing Your CodePlease make sure your code passes all tests. Our test code coverage system will fail if these conditions occur:
The process helps maintain the overall reliability of the code base and is a prerequisite for getting your PR approved. Assigned reviewers regularly review the PR queue and tend to focus on PRs that are passing. ReviewersWhen your PR has been assigned reviewers contact them to get your code reviewed and approved via:
Reviewing Your CodeYour reviewer(s) will have the following roles:
CONTRIBUTING.mdRead our CONTRIBUTING.md file. Most importantly:
Other
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congratulations on making your first PR! 🎊 If you haven't already, check out our Contributing Guidelines and PR Reporting Guidelines to ensure that you are following our guidelines for contributing and creating PR.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #1489 +/- ##
===========================================
- Coverage 98.17% 97.59% -0.59%
===========================================
Files 184 215 +31
Lines 10767 12990 +2223
Branches 835 1022 +187
===========================================
+ Hits 10571 12677 +2106
- Misses 186 298 +112
- Partials 10 15 +5 ☔ View full report in Codecov by Sentry. |
Graphql working group is working on a solution for colocated errors, it is discussed in this rfc:- https://github.com/graphql/graphql-wg/blob/main/rfcs/ClientControlledNullability.md Example:- facebook/relay#4416 With this errors would be catched at the component level by referencing its associated graphql fragment and mapping it to the This makes errors as data approach kinda useless. Since the graphql clients will allow us to declaratively handle the errors instead of imperatively checking the root errors array. The errors as data approach isn't prevalent in talawa-api right now, they're only implemented for Instead of errors as data approach, errors should just be thrown in the resolvers like the plain old way. |
So we dont have to change anything in the api and have to define fragments in the frontend to handle errors at the component level. |
What kind of change does this PR introduce?
Feature
Issue Number:
Fixes #1474
Did you add tests for your changes?
Yes
Snapshots/Videos:
If relevant, did you update the documentation?
Summary
Now the user resolver return the data and the error array separately. I have added a
newAuthDirectiveTransformer
file to handle allUnauthenticatedError
seperately in every resolver.Does this PR introduce a breaking change?
Changes the Schema in User resolver.
Other information
Have you read the contributing guide?