fix: hotfix for graphql api error (#1409)

This commit is contained in:
Anurag Hazra authored and GitHub committed 2021-10-23 13:50:33 +05:30
1 parent 02e714aeb4
commit d049f0688d
3 files changed
+9 -4

No files matched your search

+5 -2
View File
@@ -25,7 +25,10 @@ const fetcher = (variables, token) => {
pullRequests(first: 1) { pullRequests(first: 1) {
totalCount totalCount
} }
issues(first: 1) { openIssues: issues(states: OPEN) {
totalCount
}
closedIssues: issues(states: CLOSED) {
totalCount totalCount
} }
followers { followers {
@@ -114,7 +117,7 @@ async function fetchStats(
const user = res.data.data.user; const user = res.data.data.user;
stats.name = user.name || user.login; stats.name = user.name || user.login;
stats.totalIssues = user.issues.totalCount; stats.totalIssues = user.openIssues.totalCount + user.closedIssues.totalCount;
// normal commits // normal commits
stats.totalCommits = user.contributionsCollection.totalCommitContributions; stats.totalCommits = user.contributionsCollection.totalCommitContributions;
+2 -1
View File
@@ -35,7 +35,8 @@ const data = {
restrictedContributionsCount: 100, restrictedContributionsCount: 100,
}, },
pullRequests: { totalCount: stats.totalPRs }, pullRequests: { totalCount: stats.totalPRs },
issues: { totalCount: stats.totalIssues }, openIssues: { totalCount: stats.totalIssues },
closedIssues: { totalCount: 0 },
followers: { totalCount: 0 }, followers: { totalCount: 0 },
repositories: { repositories: {
totalCount: 1, totalCount: 1,
+2 -1
View File
@@ -14,7 +14,8 @@ const data = {
restrictedContributionsCount: 50, restrictedContributionsCount: 50,
}, },
pullRequests: { totalCount: 300 }, pullRequests: { totalCount: 300 },
issues: { totalCount: 200 }, openIssues: { totalCount: 100 },
closedIssues: { totalCount: 100 },
followers: { totalCount: 100 }, followers: { totalCount: 100 },
repositories: { repositories: {
totalCount: 5, totalCount: 5,