fix(plugins/stargazers): broken because of #1137

This commit is contained in:
lowlighter
2022-07-21 07:41:34 -04:00
parent 31e289b8af
commit 6c04485039
2 changed files with 4 additions and 2 deletions

View File

@@ -5,7 +5,8 @@ description: |
> ⚠️ This plugin significantly increase file size, consider using it as standalone. > ⚠️ This plugin significantly increase file size, consider using it as standalone.
examples: examples:
default: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.skyline.svg +GitHub Skyline: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.skyline.svg
GitHub City: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.skyline.city.svg
index: 26 index: 26
supports: supports:
- user - user

View File

@@ -24,6 +24,7 @@ export default async function({login, graphql, data, imports, q, queries, accoun
const {repository: {stargazers: {edges}}} = await graphql(queries.stargazers({login: owner, repository, after: cursor ? `after: "${cursor}"` : "", location: _worldmap ? "node { location }" : ""})) const {repository: {stargazers: {edges}}} = await graphql(queries.stargazers({login: owner, repository, after: cursor ? `after: "${cursor}"` : "", location: _worldmap ? "node { location }" : ""}))
cursor = edges?.[edges?.length - 1]?.cursor cursor = edges?.[edges?.length - 1]?.cursor
dates.push(...edges.map(({starredAt}) => new Date(starredAt))) dates.push(...edges.map(({starredAt}) => new Date(starredAt)))
if (_worldmap)
locations.push(...edges.map(({node: {location}}) => location)) locations.push(...edges.map(({node: {location}}) => location))
pushed = edges.length pushed = edges.length
} while ((pushed) && (cursor)) } while ((pushed) && (cursor))