Split issues to openIssues and closedIssues

This commit is contained in:
ryo-ma 2021-10-31 14:19:17 +09:00
parent b2522282b3
commit 4dde40a743
2 changed files with 9 additions and 3 deletions

View file

@ -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
}
}

View file

@ -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;