question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stats and languages results incorrect due to graphql 100 records limit

See original GitHub issue

Describe the bug

The current language and stats card results are incorrect for users with more than 100 repositories (see https://docs.github.com/en/graphql/overview/resource-limitations). This is because we are currently only fetching the first 100 repositories of a user account.

https://github.com/anuraghazra/github-readme-stats/blob/a68abbb9b3a47ad73988f37fce274e882e86b7ad/src/fetchers/stats-fetcher.js#L47

https://github.com/anuraghazra/github-readme-stats/blob/a68abbb9b3a47ad73988f37fce274e882e86b7ad/src/fetchers/top-languages-fetcher.js#L17

Because of this not all languages and stars of a user are represented.

Expected behaviour

I think we can use pagination options (i.e. cursor, after, endCursor objects) to loop through all repositories of a user account (see https://stackoverflow.com/a/70039506/8135687). @anuraghazra Let me know what you think.

TODOs

  • Allow fetching of multiple pages for the languages data. #2111.
  • Improve the stats card such that it fetches more pages when a user has more than 100 repositories with stars. #2100
    • Merge #2159 to make this available on private Vercel instances while giving us the control to disable it on the public instance because of rate-limiting problems.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:4
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rickstaacommented, Oct 12, 2022

@milkshakegum Thanks for your report. Merging:

Will fix the issues you experience. You can already use these on your own fork. They are not yet merged into the master because we have to ensure the GraphQL and Vercel limits are not hit. We will likely implement this as an opt-in for Vercel instance and Github Action users (see https://github.com/anuraghazra/github-readme-stats/issues/2179 and https://github.com/anuraghazra/github-readme-stats/pull/2159).

1reaction
rickstaacommented, Oct 10, 2022

Just a heads-up, I filled a feature request to make the total stars a specific user has received on his/her repositories available under the user object of the GraphQL API. Adding this feature would also enable #2111 on the public instance.https://github.com/community/community/discussions/35677. Please add your support there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GraphQL vs. REST APIs: Why you shouldn't use GraphQL
Now that we've outlined some use cases that call for using GraphQL, let's discuss some reasons why you might want to consider using...
Read more >
Pagination | GraphQL
A common use case in GraphQL is traversing the relationship between sets of objects. There are a number of different ways that these...
Read more >
Result size calculation for Facebook's GraphQL query language
To cope with this problem, they propose an algorithm for calculating the exact size of the response object from a query sent to...
Read more >
Export limits - Product Documentation | ServiceNow
If you export 30,000 records, the number of records returned from the database is 10,000. The number of records specified for export exceeds...
Read more >
How to display more than 100 documents with graphql?
I'm aware of the max 20 documents limit and how to use cursors and pagination to retrieve all the results. But the problem...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found