-
Notifications
You must be signed in to change notification settings - Fork 11
Skip custom NotNull errors on custom error rendering #314
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
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (65.21%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #314 +/- ##
==========================================
- Coverage 98.57% 98.17% -0.41%
==========================================
Files 67 68 +1
Lines 1901 1920 +19
==========================================
+ Hits 1874 1885 +11
- Misses 27 35 +8 🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR implements functionality to skip custom NotNull errors when custom error rendering is used. The main purpose is to prevent GraphQL null errors from being shown to users when errors have already been manually rendered by the controller.
- Adds type error hooks (
before_type_errorandafter_type_error) to the GraphQL router for custom error handling - Introduces a
rendered_errorsflag in the GraphQL context to track when errors have been manually rendered - Modifies the schema to skip
GraphQL::InvalidNullErrorwhen therendered_errorsflag is set
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/graphql_rails/router/schema.rb | Creates new Schema class with type error handling and null error skipping logic |
| lib/graphql_rails/router/schema_builder.rb | Refactors to use the new Schema class instead of inline GraphQL::Schema |
| lib/graphql_rails/controller.rb | Sets rendered_errors flag in context when errors are rendered |
| lib/graphql_rails/router.rb | Adds type error hook methods to the router's raw action names |
| spec/lib/graphql_rails/controller_spec.rb | Adds test coverage for the rendered_errors flag behavior |
| spec/lib/graphql_rails/controller/handle_controller_error_spec.rb | Adds test coverage for error handling scenarios |
| docs/components/routes.md | Documents the new type error hook functionality |
| CHANGELOG.md | Records the changes in the changelog |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Pull Request Overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
No description provided.