{{ message }}
Remove the unused rateLimit selection from the MaxPullRequest GraphQL query#8812
Draft
kamil-gwozdz wants to merge 1 commit into
Draft
Remove the unused rateLimit selection from the MaxPullRequest GraphQL query#8812kamil-gwozdz wants to merge 1 commit into
kamil-gwozdz wants to merge 1 commit into
Conversation
MaxPullRequest is a very high-frequency change-detection poll, and its handler (_getMaxItem) only reads the latest PR number — it never consumes the rateLimit block. The only generic consumer (RateLogger.logRateLimit) already degrades gracefully when rateLimit is absent (it falls back to the ?? 5000 / ?? 1000 defaults and other queries still report it), so removing this top-level field from the hottest query has no functional impact. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

TBD — author to fill in.
🤖 AI-generated description
What changed
This PR removes the top-level
rateLimit { ...RateLimit }selection from theMaxPullRequestquery insrc/github/queriesShared.gql. No other queries are touched —MaxIssueand the ~28 other operations that selectrateLimitkeep it, and the sharedfragment RateLimit on RateLimitremains in use elsewhere, so it stays defined.Why
MaxPullRequestis a high-frequency, per-repo change-detection poll — one of the hottest GraphQL operations the extension emits. Its handler_getMaxItem(src/github/githubRepository.ts) reads onlydata.repository.issues.edges[0].node.number(the latest PR number) and never touchesdata.rateLimit. SelectingrateLimiton every poll asks the GitHub GraphQL API to resolve an extra top-level field whose result is discarded. Dropping it trims that unused resolver from the highest-volume query.Scope & safety
RateLogger.logRateLimit(src/github/loggingOctokit.ts), invoked by theLoggingApolloClient.querywrapper on every query. It readsresolvedResult?.data?.rateLimitand already degrades gracefully when the field is absent: it falls back to?? 5000/?? 1000defaults. As a result, removing the selection produces no spurious "Unexpectedly low rate limit" warning, and thepr.lowRateLimitRemainingtelemetry simply does not fire for this single call path.rateLimitcontinues to report it, so overall rate-limit monitoring and telemetry are unaffected._getMaxItemdoes not referencerateLimit, and theMaxIssueResponseinterface still applies toMaxIssue. The.gqlfiles are loaded at build time via the graphql-tag webpack loader; there is no committed generated TypeScript to regenerate.Notes
MaxPullRequestonly, leavingMaxIssueand all otherrateLimit-selecting queries as-is.logRateLimitalready handles the missing-field case, this is a safe no-op for behavior — it only reduces whatMaxPullRequestasks the API to resolve.