Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Empty top languages #1640

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

Closed
a-menshchikov opened this issue Mar 10, 2022 · 2 comments
Closed

Empty top languages #1640

a-menshchikov opened this issue Mar 10, 2022 · 2 comments
Labels
bug Something isn't working. enhancement New feature or request. question Further information is requested.

Comments

@a-menshchikov
Copy link

I have an empty Top Languages (https://github-readme-stats.vercel.app/api/top-langs/?username=a-menshchikov):
image

Could you explain why?

Previously I have thought that it's a temporary bug, but I see it more than 6 months.

@rickstaa rickstaa added bug Something isn't working. upstream Problems caused by upstream issues. labels Mar 15, 2022
@rickstaa
Copy link
Collaborator

@a-menshchikov Thanks for your issue. I checked your problem and it seems that something goes wrong while trying to fetch language data for your username using the GraphQL API. You can see this in action by using the following query in the graphql explorer:

query userInfo($login: String!) {
  user(login: $login) {
    # fetch only owner repos & not forks
    repositories(ownerAffiliations: OWNER, isFork: false, first: 100) {
      nodes {
        name
        languages(first: 10, orderBy: {field: SIZE, direction: DESC}) {
          edges {
            size
            node {
              color
              name
            }
          }
        }
      }
    }
  }
}

You can then use the following in the query variables field.

{"login": "a-menshchikov"}

Fetching the user stats for your account doesn't cause any problems:

query userInfo($login: String!) {
  user(login: $login) {
    repositories(first: 100, orderBy: {direction: DESC, field: STARGAZERS}) {
      totalCount
      nodes {
        name
        stargazers {
          totalCount
        }
      }
    }
  }
}

However, I noticed that you only have forks after looking through your repositories. We currently do not fetch data from forks only from parent repositories. This behaviour can be seen by changing the isFork parameter in the query to true, after which the language stats your looking for show up.

@rickstaa rickstaa removed the upstream Problems caused by upstream issues. label Mar 15, 2022
@rickstaa
Copy link
Collaborator

rickstaa commented Mar 15, 2022

I agree that this behaviour should be documented. A feature request for also counting language information for code that is found in forks can be found in #1437. I will close this issue for now. Feel free to comment if you still need help.

@rickstaa rickstaa added question Further information is requested. enhancement New feature or request. labels Mar 15, 2022
Repository owner locked and limited conversation to collaborators May 27, 2022
@rickstaa rickstaa converted this issue into discussion #1789 May 27, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
bug Something isn't working. enhancement New feature or request. question Further information is requested.
Projects
None yet
Development

No branches or pull requests

2 participants