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
#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.
addLabels Mutation: The mutation string for adding labels should be moved to ai/mcp/server/github-workflow/services/queries/mutations.mjs.
removeLabels Mutation: The mutation string for removing labels should also be moved to ai/mcp/server/github-workflow/services/queries/mutations.mjs.
Task
- Define a new
GET_ISSUE_AND_LABEL_IDS query in issueQueries.mjs and remove the inline version from IssueService.mjs.
- Define new
ADD_LABELS and REMOVE_LABELS mutations in mutations.mjs and remove the inline versions from IssueService.mjs.
- Update
IssueService.mjs to import and use these new, externalized GraphQL operations.
- Ensure all functionality remains the same after the refactoring.
The
ai/mcp/server/github-workflow/services/IssueService.mjscurrently 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 theservices/queries/directory.Queries and Mutations to Externalize
#getIdsQuery: 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 toai/mcp/server/github-workflow/services/queries/issueQueries.mjs.addLabelsMutation: The mutation string for adding labels should be moved toai/mcp/server/github-workflow/services/queries/mutations.mjs.removeLabelsMutation: The mutation string for removing labels should also be moved toai/mcp/server/github-workflow/services/queries/mutations.mjs.Task
GET_ISSUE_AND_LABEL_IDSquery inissueQueries.mjsand remove the inline version fromIssueService.mjs.ADD_LABELSandREMOVE_LABELSmutations inmutations.mjsand remove the inline versions fromIssueService.mjs.IssueService.mjsto import and use these new, externalized GraphQL operations.