Skip to content

Conversation

@Knerio
Copy link
Member

@Knerio Knerio commented Nov 13, 2025

close #646

@Knerio Knerio changed the title djust mutation error responses Adjust mutation error responses Nov 13, 2025
@Knerio Knerio requested a review from Taucher2003 November 13, 2025 20:47
@Knerio Knerio self-assigned this Nov 13, 2025
@Knerio Knerio requested a review from Copilot November 13, 2025 20:47
Copilot finished reviewing on behalf of Knerio November 13, 2025 20:48
Copy link

Copilot AI left a 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 errorCode and details fields
  • Updating ServiceResponse.error() to require an error_code parameter and use a structured payload format
  • Adding new error codes to the ErrorCodeEnum for better error classification
  • Creating a new DetailedError union 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.

@github-actions
Copy link

github-actions bot commented Nov 13, 2025

GitLab Pipeline Action

General information

Link to pipeline: https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2157719082

Status: Passed
Duration: 4 minutes

Job summaries

rspec: [ee]

Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/12083610674/artifacts/tmp/coverage/index.html
Test summary available at https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2157719082/test_report
Finished in 22.81 seconds (files took 12.74 seconds to load)
1188 examples, 0 failures
Line Coverage: 91.45% (4023 / 4399)
[TEST PROF INFO] Time spent in factories: 00:11.896 (41.85% of total time)

rspec: [ce]

Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/12083610673/artifacts/tmp/coverage/index.html
Test summary available at https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2157719082/test_report
Finished in 19.72 seconds (files took 13.86 seconds to load)
1141 examples, 0 failures
Line Coverage: 90.84% (3856 / 4245)
[TEST PROF INFO] Time spent in factories: 00:10.021 (36.88% of total time)

rubocop

669 files inspected, no offenses detected

@Knerio Knerio requested a review from Copilot November 13, 2025 20:58
@Knerio
Copy link
Member Author

Knerio commented Nov 13, 2025

@copilot did i fix your suggestions correctly?

Copy link

Copilot AI commented Nov 13, 2025

@Knerio I've opened a new pull request, #671, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot finished reviewing on behalf of Knerio November 13, 2025 21:00
Copy link

Copilot AI left a 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.

@Knerio Knerio force-pushed the 646-adjust-mutation-error-responses branch from 2ac052a to 586839c Compare November 13, 2025 21:03
Copy link

Copilot AI commented Nov 13, 2025

@Knerio I've opened a new pull request, #672, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Nov 13, 2025

@Knerio I've opened a new pull request, #673, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Nov 13, 2025

@Knerio I've opened a new pull request, #674, to work on those changes. Once the pull request is ready, I'll request review from you.

@Knerio Knerio force-pushed the 646-adjust-mutation-error-responses branch from 3436d5f to 15f4545 Compare November 13, 2025 21:18
@Knerio Knerio requested a review from Copilot November 13, 2025 21:18
Copy link

Copilot AI commented Nov 13, 2025

@Knerio I've opened a new pull request, #680, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits November 13, 2025 21:25
Co-authored-by: Knerio <96529060+Knerio@users.noreply.github.com>
Copy link

Copilot AI commented Nov 13, 2025

@Knerio I've opened a new pull request, #681, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Nov 13, 2025

@Knerio I've opened a new pull request, #682, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 4 commits November 13, 2025 21:28
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
@Knerio Knerio force-pushed the 646-adjust-mutation-error-responses branch from f141a3d to 83600fc Compare November 13, 2025 21:33
Add missing organization_not_found error code
Add missing email_verification_send_failed error code definition
@Knerio Knerio force-pushed the 646-adjust-mutation-error-responses branch from 312798c to a97881e Compare November 13, 2025 21:37
@Knerio Knerio requested a review from Copilot November 13, 2025 21:37
Copilot finished reviewing on behalf of Knerio November 13, 2025 21:40
Copy link

Copilot AI left a 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.

Copy link

Copilot AI commented Nov 13, 2025

@Knerio I've opened a new pull request, #684, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits November 13, 2025 21:47
Co-authored-by: Knerio <96529060+Knerio@users.noreply.github.com>
Fix invalid_namespace_member error code description
@Knerio Knerio force-pushed the 646-adjust-mutation-error-responses branch from fecb40c to f68fb15 Compare November 13, 2025 21:56
@Knerio Knerio requested a review from Copilot November 13, 2025 22:02
Copilot finished reviewing on behalf of Knerio November 13, 2025 22:04
Copy link

Copilot AI left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adjust mutation error responses

2 participants