Skip to content

Commit ba98814

Browse files
committed
Fix user not found
1 parent 30edbae commit ba98814

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

stats-generator.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const extractGraphqlJson = res => {
5151
if (res.errors && res.errors.length > res.data.length) {
5252
throw res
5353
}
54-
return res.data.filter(x => x !== null)
54+
return res
5555
})
5656
}
5757

@@ -125,7 +125,13 @@ const fetchCountStats = (users) => {
125125
}
126126
`
127127

128-
return githubQuery(statsQuery).then(extractGraphqlJson).then(res => res.data).then(res => {
128+
return githubQuery(statsQuery).then(extractGraphqlJson).then(res => Object.entries(res.data).reduce((obj, [key, value]) => {
129+
if (value === null) {
130+
131+
return obj
132+
}
133+
return { ...obj, [key]: value }
134+
}, {})).then(res => {
129135
return Object.entries(res).reduce((acc, user) => {
130136
acc[user[0].replace(/___kebab___/g, "-").replace(/__NUMBER__/g, "")] = extractCountStats(user[1])
131137
return acc

0 commit comments

Comments
 (0)