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 |
|---|---|---|---|
username | string | yes | — |
scope | readonly string[] | undefined | no | owner/name and owner/* entries the searches are narrowed to. |
searches | readonly ("issues_commented" | "issues_opened" | "prs_commented" | "prs_opened" | "prs_reviewed")[] | undefined | no | The counts to fetch, one search each; the rest are left out. |
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 entry of searches. Ask for none and it makes no request at all.