[github-data] fix: switch contributions queries from user(login) to viewer form#24
Merged
Merged
Conversation
…iewer form GitHub treats `user(login: $login).contributionsCollection` as a third-party query and only returns what's visible on the user's public profile graph -- private contributions get omitted from per-repo / per-day breakdowns even when the authenticated user IS that login and the "Include private contributions on profile" toggle is enabled. Result: every private commit silently dropped out of the activity feed regardless of PAT scope or profile settings. Switch all four contributions queries (main, paginate PRs, paginate issues, paginate reviews) to the `viewer` form which returns the authenticated viewer's complete contributions including granular private-repo data. Drops the now-unused $login variable from each query and the `login` parameter from `fetchContributionsCollection`. The viewer login is still captured via `fetchViewerLogin` for the SyncActivityResult diagnostic. Tests updated to use the `viewer` mock shape; 489/489 pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughVersion bump from 0.0.4 to 0.0.5. Primary functional change: refactored Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This was referenced Apr 30, 2026
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.
Summary
GitHub treats `user(login: $login).contributionsCollection` as a third-party query and only returns what's visible on the user's public profile graph -- private contributions get omitted from per-repo / per-day breakdowns even when the authenticated user IS that login and "Include private contributions on profile" is enabled.
Result: every private commit silently dropped out of the activity feed regardless of PAT scope or profile settings.
Fix
Switch all four contributions queries (main, paginate PRs, paginate issues, paginate reviews) to the `viewer` form, which returns the authenticated viewer's complete contributions including granular private-repo data.
Repro before / after
Before (v0.0.4):
After (v0.0.5):
Tests
489 / 489 passing. Updated mock fixtures in `graphql.test.ts` and `activity-writer.test.ts` to use the `viewer` response shape; updated test names + assertions to reflect the new `viewer`-not-found error message.
Tag
v0.0.5 tag already pushed (points at the patched commit on this branch). BRAT will see it on next refresh after merge.
Test plan
🤖 Generated with Claude Code