LearnNewsExamplesServices
Frontmatter
id7621
titleRefactor IssueService to Externalize GraphQL Queries
stateClosed
labels
enhancementairefactoring
assigneestobiu
createdAtOct 23, 2025, 3:25 PM
updatedAtOct 23, 2025, 3:26 PM
githubUrlhttps://github.com/neomjs/neo/issues/7621
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtOct 23, 2025, 3:26 PM

Refactor IssueService to Externalize GraphQL Queries

Closed v11.0.0 enhancementairefactoring
tobiu
tobiu commented on Oct 23, 2025, 3:25 PM

The ai/mcp/server/github-workflow/services/IssueService.mjs currently contains inline GraphQL query and mutation strings. This violates the separation of concerns principle we have established, where all GraphQL operations should be defined in dedicated files within the services/queries/ directory.

Queries and Mutations to Externalize

  1. #getIds Query: The query inside this private method fetches the GraphQL node ID for an issue and the node IDs for a set of labels. This query should be moved to ai/mcp/server/github-workflow/services/queries/issueQueries.mjs.
  2. addLabels Mutation: The mutation string for adding labels should be moved to ai/mcp/server/github-workflow/services/queries/mutations.mjs.
  3. removeLabels Mutation: The mutation string for removing labels should also be moved to ai/mcp/server/github-workflow/services/queries/mutations.mjs.

Task

  1. Define a new GET_ISSUE_AND_LABEL_IDS query in issueQueries.mjs and remove the inline version from IssueService.mjs.
  2. Define new ADD_LABELS and REMOVE_LABELS mutations in mutations.mjs and remove the inline versions from IssueService.mjs.
  3. Update IssueService.mjs to import and use these new, externalized GraphQL operations.
  4. Ensure all functionality remains the same after the refactoring.
tobiu assigned to @tobiu on Oct 23, 2025, 3:25 PM
tobiu added the enhancement label on Oct 23, 2025, 3:25 PM
tobiu added the ai label on Oct 23, 2025, 3:25 PM
tobiu added the refactoring label on Oct 23, 2025, 3:25 PM
tobiu referenced in commit 5cbad8b - "Refactor IssueService to Externalize GraphQL Queries #7621" on Oct 23, 2025, 3:26 PM
tobiu closed this issue on Oct 23, 2025, 3:26 PM