Skip to content

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

@tc-imba

Description

@tc-imba

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ⭐ top bugTop bug.bugSomething isn't working.lang-cardIssues related to the language card.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions