Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The most used languages only count the oldest 100 projects #1177

Open
tc-imba opened this issue Jul 8, 2021 · 0 comments · Fixed by yi-ge/github-readme-stats#1 or #2100 · May be fixed by #2111
Open

The most used languages only count the oldest 100 projects #1177

tc-imba opened this issue Jul 8, 2021 · 0 comments · Fixed by yi-ge/github-readme-stats#1 or #2100 · May be fixed by #2111
Labels
bug Something isn't working. lang-card Issues related to the language card. ⭐ top bug Top bug.

Comments

@tc-imba
Copy link

tc-imba commented Jul 8, 2021

Describe the bug

The most used languages count only count the oldest 100 projects sorted by time. The new projects are not counted

Expected behavior

The most used languages count should count all projects

Screenshots / Live demo link (paste the github-readme-stats link as markdown image)

I test it in https://docs.github.com/en/graphql/overview/explorer

The current graphql is like

{
  user(login: "tc-imba") {
    repositories(ownerAffiliations: OWNER, isFork: false, first: 100) {
      nodes {
        name
        languages(first: 10, orderBy: {field: SIZE, direction: DESC}) {
          edges {
            size
            node {
              color
              name
            }
          }
        }
      }
    }
  }
}

github limit the first to be 100, but we can add a parameter start to use the pagination and traverse all pages.

For example, we can add edges { cursor } and get a list of cursors

{
  user(login: "tc-imba") {
    repositories(ownerAffiliations: OWNER, isFork: false, first: 100) {
      edges {
        cursor
      }
      nodes {
        name
        languages(first: 10, orderBy: {field: SIZE, direction: DESC}) {
          edges {
            size
            node {
              color
              name
            }
          }
        }
      }
    }
  }
}

It shows that the cursor of the last repo is Y3Vyc29yOnYyOpHOCWwxJg==, and then we can use start: "Y3Vyc29yOnYyOpHOCWwxJg==" to find the 101-200 repos, and so on

Additional context
I'll draft a PR for this later

@rickstaa rickstaa added bug Something isn't working. lang-card Issues related to the language card. labels Mar 9, 2022
yi-ge added a commit to yi-ge/github-readme-stats that referenced this issue Aug 25, 2022
@rickstaa rickstaa reopened this Oct 4, 2022
@MatteoPierro MatteoPierro linked a pull request Oct 4, 2022 that will close this issue
@rickstaa rickstaa added the ⭐ top bug Top bug. label May 9, 2023
@github-actions github-actions bot added ⭐ top bug Top bug. and removed ⭐ top bug Top bug. labels Jun 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. lang-card Issues related to the language card. ⭐ top bug Top bug.
Projects
None yet
2 participants