GraphQL returns RESOURCE_LIMITS_EXCEEDED when combining contributionsCollection and repositoriesContributedTo for a specific user #202200
Replies: 5 comments
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
This looks like a resource-limit interaction between
Workaround: scope query {
user(login: "plinkr") {
contributionsCollection(from: "2025-01-01T00:00:00Z", to: "2025-12-31T23:59:59Z") {
totalCommitContributions
totalPullRequestReviewContributions
}
repositoriesContributedTo(first: 1) {
totalCount
}
}
}If you need full-lifetime totals, paginate year by year and sum the results client-side, rather than requesting the whole history combined with If that still throws |
Beta Was this translation helpful? Give feedback.
-
|
Based on the information you've provided, this appears to be an internal GraphQL resolver limitation rather than an issue with your query or the GitHub CLI. A useful diagnostic step would be to execute the same query while constraining Conversely, if the query continues to return
there appears to be sufficient evidence to justify further investigation by the GitHub GraphQL team into the resolver behavior for this specific account. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks to the both of you for the detailed analysis, I ran the follow-up test you suggested (narrowing
In every failing case, the error |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for running the tests — the table actually confirms the complexity hypothesis and narrows it down further:
So the resolver cost scales with your review contribution graph (likely reviews in large/busy repositories are expensive to cross-reference), and the combined query trips GitHub's internal complexity limit — which Definitive workaround: since each field works fine on its own (your original standalone lifetime query succeeded), just split them into two separate requests: # request 1
query {
user(login: "plinkr") {
contributionsCollection {
totalCommitContributions
totalPullRequestReviewContributions
}
}
}# request 2
query {
user(login: "plinkr") {
repositoriesContributedTo(first: 1) {
totalCount
}
}
}Two requests cost you nothing extra in rate limit terms (both are cost 1) and remove the failure mode entirely — no date-window guessing needed. Beyond the workaround, your table is solid evidence for the GitHub team that the GraphQL cost model under-reports the real resolver cost of |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
🏷️ Discussion Type
Bug
💬 Feature/Topic Area
API
Body
Hello,
I'm seeing a
RESOURCE_LIMITS_EXCEEDEDGraphQL error for my account (plinkr) when combiningcontributionsCollectionwithrepositoriesContributedTo.Each field works correctly when queried independently, but combining them in the same query consistently fails.
This behavior started recently without any changes to my application.
I can reproduce it directly using GitHub CLI, so this does not appear to be related to any third-party library.
Environment
Authenticated using a Personal Access Token.
Successful queries
contributionsCollection
Response:
{ "data": { "user": { "commits": { "totalCommitContributions": 148 } } } }repositoriesContributedTo
This also succeeds.
Failing query
Response:
{ "data": { "user": null }, "errors": [ { "type": "RESOURCE_LIMITS_EXCEEDED", "path": [ "user", "repositoriesContributedTo" ], "locations": [ { "line": 8, "column": 5 } ], "message": "Resource limits for this query exceeded." } ] }Additional observations
The same happens when combining
repositoriesContributedTowith anothercontributionsCollectionfield:This also returns
RESOURCE_LIMITS_EXCEEDED.Likewise, querying both contribution totals from a single
contributionsCollectionobject still fails whenrepositoriesContributedTois included:Response:
{ "data": { "user": null }, "errors": [ { "type": "RESOURCE_LIMITS_EXCEEDED", "path": [ "user", "contributionsCollection", "totalPullRequestReviewContributions" ], "locations": [ { "line": 6, "column": 7 } ], "message": "Resource limits for this query exceeded." } ] }Comparison
The same queries succeed for other users, for example:
octocattorvaldsFor example, the following query succeeds for
torvalds:The
rateLimit.costis reported as 1, even for the failing query.Could this be an account-specific issue affecting how
contributionsCollectionandrepositoriesContributedToare resolved together?Beta Was this translation helpful? Give feedback.
All reactions