-
Notifications
You must be signed in to change notification settings - Fork 0
Adjust mutation error responses #670
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
base: main
Are you sure you want to change the base?
Conversation
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 refactors the GraphQL mutation error response structure to use a consistent error handling pattern. The changes move from a union-based error system to an object-based approach where errors have an errorCode field and an optional details array for additional error information.
Key changes include:
- Restructuring the Error GraphQL type from a union to an object with
errorCodeanddetailsfields - Updating
ServiceResponse.error()to require anerror_codeparameter and use a structured payload format - Adding new error codes to the ErrorCodeEnum for better error classification
- Creating a new
DetailedErrorunion type for the details field to handle different error detail types
Reviewed Changes
Copilot reviewed 183 out of 183 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| app/services/service_response.rb | Refactored error method to require error_code and structure payload consistently |
| app/graphql/types/errors/error_type.rb | Changed from union to object type with errorCode and details fields |
| app/graphql/types/errors/detailed_error_type.rb | New union type for detailed error information |
| lib/sagittarius/graphql/error_container.rb | Renamed and restructured to hold error_code and details |
| app/services/error_code.rb | Added many new error code definitions |
| app/services//.rb | Updated all service error responses to use new format |
| app/graphql/mutations/base_mutation.rb | Updated create_error helper to use new ErrorContainer structure |
| spec/support/helpers/graphql_helpers.rb | Updated error_query helper to match new error structure |
| spec/**/*_spec.rb | Updated all specs to access errors via new structure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
GitLab Pipeline ActionGeneral informationLink to pipeline: https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2157719082 Status: Passed Job summariesrspec: [ee]Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/12083610674/artifacts/tmp/coverage/index.html rspec: [ce]Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/12083610673/artifacts/tmp/coverage/index.html rubocop669 files inspected, no offenses detected |
|
@copilot did i fix your suggestions correctly? |
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 183 out of 183 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2ac052a to
586839c
Compare
586839c to
3436d5f
Compare
3436d5f to
15f4545
Compare
Co-authored-by: Knerio <96529060+Knerio@users.noreply.github.com>
Co-authored-by: Knerio <96529060+Knerio@users.noreply.github.com>
Fix grammar typo in FlowValidationErrorType description
Co-authored-by: Knerio <96529060+Knerio@users.noreply.github.com>
Add missing invalid_totp_secret error code definition
f141a3d to
83600fc
Compare
Add missing organization_not_found error code
Add missing email_verification_send_failed error code definition
312798c to
a97881e
Compare
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 183 out of 183 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Knerio <96529060+Knerio@users.noreply.github.com>
Fix invalid_namespace_member error code description
fecb40c to
f68fb15
Compare
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 183 out of 183 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
close #646