ChoukseyKhushbu / Gitzilla

A resume builder for your GitHub profile.
https://gitzilla.netlify.app/
MIT License
63 stars 10 forks source link

The repo card is not showing all languages #27

Closed ming-tsai closed 3 years ago

ming-tsai commented 3 years ago

The repo card is only showing one or not showing the language but Github says it has more than one GitZilla image

GitHub image I can work on this change if it's ok with you.

ChoukseyKhushbu commented 3 years ago

Hi @ming-tsai, I checked the issue it's because in the GitHub API, language is set to null for this repo as well as for some other repositories too. Have a look at this - https://api.github.com/repos/ming-tsai/emplea_do

Okay if you want to work on this change, I am assigning this issue to you. Do give me the updates or changes you are going to do to solve the issue.

ming-tsai commented 3 years ago

Hi @ChoukseyKhushbu, I'm working on this issue, but to let you know for getting whole languages just use this endpoint https://api.github.com/repos/ming-tsai/emplea_do/languages

ming-tsai commented 3 years ago

@ChoukseyKhushbu I highly recommend using Github token on the header, due to we have to make a request for each repository to get all languages and it is getting error by the rate limit.

Please let me know what you decide.

ChoukseyKhushbu commented 3 years ago

Yes @ming-tsai! I recognize the issue. We should shift to using GitHub token (Personal Access Token) as the application demands more API calls now. And I really apologize for replying very late as I had faced some issues with my laptop.

I will soon add a .env.sample for the same.

ming-tsai commented 3 years ago

Ok @ChoukseyKhushbu I will wait for your commit

ChoukseyKhushbu commented 3 years ago

I just realized that if the user has let's say 100 repositories then in this way we will have to make 100 requests which don't seem to me like an ideal solution. I have explored the GitHub GraphQL API and using that it is possible to get the languages of all the repositories in just one request. So I am already working on the implementation of this but it would be really helpful if you could write a query for fetching the repositories with languages.

ming-tsai commented 3 years ago

I make this query, hope this helps you

query searchUser($username: String!) {
  user(login: $username) {
    avatarUrl(size: 60)
    name
    url
    login
    bio
    websiteUrl
    location
    company
    following {
      totalCount
    }
    followers {
      totalCount
    }
    repositories(last: 100, orderBy: {field: UPDATED_AT, direction: DESC}) {
      nodes {
        name
        description
        projectsUrl
        languages(last: 5) {
          nodes {
            name
          }
        }
      }
    }
  }
}

Query variables

{
    "username" : "ming-tsai" 
}

I am a novice on GraphQL

ming-tsai commented 3 years ago

Hi @ChoukseyKhushbu, should I make change RestAPI to GraphQL?

ChoukseyKhushbu commented 3 years ago

Hi @ChoukseyKhushbu, should I make change RestAPI to GraphQL?

Okay. You can take it up!

ming-tsai commented 3 years ago

Ok, working on it

ming-tsai commented 3 years ago

@ChoukseyKhushbu, please check this pull request #33

ming-tsai commented 3 years ago

@ChoukseyKhushbu please link pull requests to this issue.

ChoukseyKhushbu commented 3 years ago

Fixed in #33

ming-tsai commented 3 years ago

May be should use this Github's feature image

ChoukseyKhushbu commented 3 years ago

May be should use this Github's feature image

Thanks for telling me this @ming-tsai. I never used this feature before. Would be of great help from now. :smiley:

ming-tsai commented 3 years ago

For linked the pull request just click the cog icon and find out the pull request that you want to link, see the example. image