diff --git a/src/github_api_client.ts b/src/github_api_client.ts index b27e8ae..be86cf4 100644 --- a/src/github_api_client.ts +++ b/src/github_api_client.ts @@ -53,7 +53,10 @@ export class GithubAPIClient { const query = ` query userInfo($username: String!) { user(login: $username) { - issues(first: 1) { + openIssues: issues(states: OPEN) { + totalCount + } + closedIssues: issues(states: CLOSED) { totalCount } } diff --git a/src/user_info.ts b/src/user_info.ts index 55b4fe3..c1b2572 100644 --- a/src/user_info.ts +++ b/src/user_info.ts @@ -12,7 +12,10 @@ export type GitHubUserRepository = { }; export type GitHubUserIssue = { - issues: { + openIssues: { + totalCount: number; + }; + closedIssues: { totalCount: number; }; }; @@ -84,7 +87,7 @@ export class UserInfo { : 0; this.totalCommits = totalCommits; this.totalFollowers = userActivity.followers.totalCount; - this.totalIssues = userIssue.issues.totalCount; + this.totalIssues = userIssue.openIssues.totalCount + userIssue.closedIssues.totalCount; this.totalOrganizations = userActivity.organizations.totalCount; this.totalPullRequests = userPullRequest.pullRequests.totalCount; this.totalStargazers = totalStargazers;