To improve code organization, maintainability, and consistency across the GitHub workflow server, we need to refactor the remaining services to externalize their GraphQL queries. The SyncService and issueQueries.mjs have established a clean pattern of separating query logic from service logic. This ticket applies that same pattern to the LabelService and PullRequestService.
Acceptance Criteria
- A new file,
ai/mcp/server/github-workflow/services/queries/labelQueries.mjs, is created.
- The GraphQL query for listing labels is moved from
LabelService.mjs into labelQueries.mjs as a named export.
LabelService.mjs is updated to import and use the query from the new file.
- A new file,
ai/mcp/server/github-workflow/services/queries/pullRequestQueries.mjs, is created.
- The GraphQL queries and mutations for
listPullRequests, createComment, and getConversation are moved from PullRequestService.mjs into pullRequestQueries.mjs as named exports.
PullRequestService.mjs is updated to import and use the queries from the new file.
- The new query modules should export default limit variables (e.g.,
DEFAULT_QUERY_LIMITS) if applicable, sourcing values from the config to avoid magic numbers, similar to the pattern in issueQueries.mjs.
To improve code organization, maintainability, and consistency across the GitHub workflow server, we need to refactor the remaining services to externalize their GraphQL queries. The
SyncServiceandissueQueries.mjshave established a clean pattern of separating query logic from service logic. This ticket applies that same pattern to theLabelServiceandPullRequestService.Acceptance Criteria
ai/mcp/server/github-workflow/services/queries/labelQueries.mjs, is created.LabelService.mjsintolabelQueries.mjsas a named export.LabelService.mjsis updated to import and use the query from the new file.ai/mcp/server/github-workflow/services/queries/pullRequestQueries.mjs, is created.listPullRequests,createComment, andgetConversationare moved fromPullRequestService.mjsintopullRequestQueries.mjsas named exports.PullRequestService.mjsis updated to import and use the queries from the new file.DEFAULT_QUERY_LIMITS) if applicable, sourcing values from the config to avoid magic numbers, similar to the pattern inissueQueries.mjs.