fix: fallback to login if name not found

This commit is contained in:
anuraghazra 2020-07-13 16:14:13 +05:30
parent fdeaad36f1
commit d56ef0d091

View File

@ -9,6 +9,7 @@ async function fetchStats(username) {
query userInfo($login: String!) {
user(login: $login) {
name
login
repositoriesContributedTo(first: 100, contributionTypes: [COMMIT, ISSUE, PULL_REQUEST, REPOSITORY]) {
totalCount
}
@ -50,7 +51,7 @@ async function fetchStats(username) {
const user = res.data.data.user;
stats.name = user.name;
stats.name = user.name || user.login;
stats.totalIssues = user.issues.totalCount;
stats.totalCommits = user.contributionsCollection.totalCommitContributions;
stats.totalPRs = user.pullRequests.totalCount;