Skip to content

Conversation

@setchy
Copy link
Member

@setchy setchy commented Dec 26, 2025

Implement GraphQL query aliasing and merging to reduce network calls and better utilize GitHub API rate limits

Sample Dataset Screenshot 2025-12-27 at 8 27 09 AM
Before - v6.14.1 release build Screenshot 2025-12-27 at 8 22 34 AM
After - #2468 + this PR Screenshot 2025-12-27 at 8 32 25 AM

For Issues, Pull Requests or Discussions, full enrichment now occurs in a single API query with a maximum query cost of 4 units

@github-actions github-actions bot added the enhancement New feature or enhancement to existing functionality label Dec 26, 2025
@setchy
Copy link
Member Author

setchy commented Dec 26, 2025

Current state of this PR is functional, but needs some further polish / refactoring, and update tests before being ready

@setchy setchy marked this pull request as draft December 26, 2025 22:39
@setchy setchy changed the title feat(api): implement merge query pattern feat(api/graphql): implement merge query pattern Dec 26, 2025
@github-actions github-actions bot removed the enhancement New feature or enhancement to existing functionality label Dec 26, 2025
@setchy setchy changed the title feat(api/graphql): implement merge query pattern feat(api): implement graphql merge query pattern Dec 29, 2025
@github-actions github-actions bot added the enhancement New feature or enhancement to existing functionality label Dec 29, 2025
@setchy setchy changed the title feat(api): implement graphql merge query pattern feat(api): implement graphql merge query pattern to reduce api call volume Dec 29, 2025
@afonsojramos afonsojramos force-pushed the feat/query-merging branch 2 times, most recently from d09207b to 02866a2 Compare December 30, 2025 02:29
afonsojramos and others added 2 commits December 30, 2025 04:05
- Add query merging infrastructure to batch multiple GraphQL queries into one
- Create BatchMergedDetailsQueryFragment for combined notification queries
- Update handlers (Discussion, Issue, PullRequest) with mergeQueryConfig
- Add INDEX suffix variable naming for merged query support
- Create getNotificationAuthor helper to handle snake_case/camelCase formats
- Guard against null URLs in notification enrichment
- Update test mocks to use nodeINDEX response format

Co-authored-by: Adam Setch <adam.setch@outlook.com>
- Remove commented-out debug code from notifications.ts
- Fix FIXME by using isAnsweredDiscussionFeatureSupported with account
- Remove unused extras field from GraphQLMergedQueryConfig type
- Add mergeQueryConfig tests for issue, pullRequest, discussion, and default handlers
- Document why integration test is skipped (complex mocking requirements)
@afonsojramos afonsojramos marked this pull request as ready for review December 30, 2025 03:28
afonsojramos
afonsojramos previously approved these changes Dec 30, 2025
@setchy
Copy link
Member Author

setchy commented Dec 30, 2025

@afonsojramos - this isn't ready yet, it's still very much a draft

@afonsojramos
Copy link
Member

Just wanted another pair of eyes! I'll keep working on this tomorrow 🙈

@setchy setchy dismissed afonsojramos’s stale review December 30, 2025 03:44

Not ready yet, I have changed I'd like to make to it still...

@setchy
Copy link
Member Author

setchy commented Dec 30, 2025

Just wanted another pair of eyes! I'll keep working on this tomorrow 🙈

What happened to my previous work on this branch, it seems you've rewrote the history and made other changes without discussion... I have local changes that I now need to untangle...

@setchy setchy marked this pull request as draft December 30, 2025 04:02
Signed-off-by: Adam Setch <adam.setch@outlook.com>
…clash in merged query

Signed-off-by: Adam Setch <adam.setch@outlook.com>
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
59.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

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

Labels

enhancement New feature or enhancement to existing functionality

Development

Successfully merging this pull request may close these issues.

3 participants