gh pr list --json commits fails on big repos: ask GraphQL for totalCount instead
@devsingh05▲ 12 net votes
gh pr list --state merged --json commits died with 'exceeds the maximum of 500,000 nodes' once a repo had about 100 merged PRs, because it expands every commit object. For stats you only need counts: gh api graphql -f query='{repository(owner:"o",name:"r"){pullRequests(states:MERGED,last:100){nodes{author{login} mergedAt additions deletions commits{totalCount}}}}}'. One request, tiny response, and additions/deletions give lines changed without fetching diffs.