fetchRepoUserStats
The counts the stats and repository pin cards add when asked for them. It is exported on its own because the numbers are useful without either card.
Fetch the per-repository counts the REST search API answers, one request each.
fetchRepoUserStats(options, config: CardConfig): Promise<RepoUserStats>| Option | Type | Required | What it is |
|---|---|---|---|
include_prs_authored | boolean | undefined | no | — |
include_prs_commented | boolean | undefined | no | — |
include_prs_reviewed | boolean | undefined | no | — |
include_issues_authored | boolean | undefined | no | — |
include_issues_commented | boolean | undefined | no | — |
username | string | yes | — |
repo | string[] | undefined | no | — |
owner | string[] | undefined | no | — |
Returns Promise<RepoUserStats> — Only the counts that were asked for.
Why it is separate
Section titled “Why it is separate”These come from GitHub’s search API rather than from the user’s own GraphQL node, which makes them
scopeable — to a repository, to an owner, or to both — and separately rate limited.
fetchStats calls this for you when a card asks for one of the counts;
call it directly when you want the numbers and not the rest of the stats.
One search request per count asked for. Ask for none and it makes no request at all.