mirror of
https://github.com/tiennm99/github-readme-stats.git
synced 2026-08-09 00:25:35 +00:00
Stats card: show started and answered discussions stats (#2849)
* Stats card: show started and answered discussions stats * trans * dev
This commit is contained in:
@@ -63,6 +63,12 @@ const GRAPHQL_STATS_QUERY = `
|
||||
followers {
|
||||
totalCount
|
||||
}
|
||||
repositoryDiscussions {
|
||||
totalCount
|
||||
}
|
||||
repositoryDiscussionComments(onlyAnswers: true) {
|
||||
totalCount
|
||||
}
|
||||
${GRAPHQL_REPOS_FIELD}
|
||||
}
|
||||
}
|
||||
@@ -190,6 +196,8 @@ const fetchStats = async (
|
||||
totalCommits: 0,
|
||||
totalIssues: 0,
|
||||
totalStars: 0,
|
||||
totalDiscussionsStarted: 0,
|
||||
totalDiscussionsAnswered: 0,
|
||||
contributedTo: 0,
|
||||
rank: { level: "C", percentile: 100 },
|
||||
};
|
||||
@@ -232,6 +240,8 @@ const fetchStats = async (
|
||||
stats.totalReviews =
|
||||
user.contributionsCollection.totalPullRequestReviewContributions;
|
||||
stats.totalIssues = user.openIssues.totalCount + user.closedIssues.totalCount;
|
||||
stats.totalDiscussionsStarted = user.repositoryDiscussions.totalCount;
|
||||
stats.totalDiscussionsAnswered = user.repositoryDiscussionComments.totalCount;
|
||||
stats.contributedTo = user.repositoriesContributedTo.totalCount;
|
||||
|
||||
// Retrieve stars while filtering out repositories to be hidden.
|
||||
|
||||
Vendored
+2
@@ -22,6 +22,8 @@ export type StatsData = {
|
||||
totalCommits: number;
|
||||
totalIssues: number;
|
||||
totalStars: number;
|
||||
totalDiscussionsStarted: number;
|
||||
totalDiscussionsAnswered: number;
|
||||
contributedTo: number;
|
||||
rank: { level: string; percentile: number };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user