LearnNewsExamplesServices
Frontmatter
id7599
titleExternalize GraphQL Queries for Label and PullRequest Services
stateClosed
labels
enhancementairefactoring
assigneestobiu
createdAtOct 22, 2025, 11:02 AM
updatedAtOct 22, 2025, 11:16 AM
githubUrlhttps://github.com/neomjs/neo/issues/7599
authortobiu
commentsCount0
parentIssue7590
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtOct 22, 2025, 11:16 AM

Externalize GraphQL Queries for Label and PullRequest Services

Closed v11.0.0 enhancementairefactoring
tobiu
tobiu commented on Oct 22, 2025, 11:02 AM

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

  1. A new file, ai/mcp/server/github-workflow/services/queries/labelQueries.mjs, is created.
  2. The GraphQL query for listing labels is moved from LabelService.mjs into labelQueries.mjs as a named export.
  3. LabelService.mjs is updated to import and use the query from the new file.
  4. A new file, ai/mcp/server/github-workflow/services/queries/pullRequestQueries.mjs, is created.
  5. The GraphQL queries and mutations for listPullRequests, createComment, and getConversation are moved from PullRequestService.mjs into pullRequestQueries.mjs as named exports.
  6. PullRequestService.mjs is updated to import and use the queries from the new file.
  7. 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.
tobiu assigned to @tobiu on Oct 22, 2025, 11:02 AM
tobiu added the enhancement label on Oct 22, 2025, 11:02 AM
tobiu added the ai label on Oct 22, 2025, 11:02 AM
tobiu added the refactoring label on Oct 22, 2025, 11:02 AM
tobiu added parent issue #7590 on Oct 22, 2025, 11:02 AM
tobiu referenced in commit dc941cf - "Externalize GraphQL Queries for Label and PullRequest Services #7599" on Oct 22, 2025, 11:12 AM
tobiu closed this issue on Oct 22, 2025, 11:16 AM