Skip to content

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>
OptionTypeRequiredWhat it is
include_prs_authoredboolean | undefinedno
include_prs_commentedboolean | undefinedno
include_prs_reviewedboolean | undefinedno
include_issues_authoredboolean | undefinedno
include_issues_commentedboolean | undefinedno
usernamestringyes
repostring[] | undefinedno
ownerstring[] | undefinedno

Returns Promise<RepoUserStats> — Only the counts that were asked for.

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.