Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 3

List of repositories of the selected user (username string) has contributed (pull req, commit, etc)

Solved! Go to Solution.

Hello everyone,

i am new for the graphql, my project is I want to build some repository dashboard in my school

 

my case is i want to my friend's public repositories that he/she has contributed to, sorted by the most recent contribution date.

 

in my case I stuck in query like this :

 

{
  search (query: "Effzz", type: USER, first: 1){
    edges {
      node {
        ... on User {
          login
          url
          avatarUrl
          bio
          repositories(first: 10 orderBy: {field: UPDATED_AT, direction: DESC}) {
            pageInfo {
              endCursor
              startCursor
              hasNextPage
              hasPreviousPage
            }
            edges {
              node {
                name
                id
                createdAt
              }
            }
          }
        }
      }
    }
  }
}

but this just showing last updated user's own repository,

any single advice is really appreciated,

 

thank you

 

2 Replies
Highlighted
Solution
Copilot Lvl 3
Message 2 of 3

Re: List of repositories of the selected user (username string) has contributed (pull req, commit, e

Hi!

 

Would this be what you're looking for? This query returns the contributions from a user grouped per repository. You might still have to do some postprocessing on the data. If this is not what you're looking for `contributionsCollection` might still contain some other fields that can be of interest to you.

 

{
  user(login: "TimonVS") {
    login
    contributionsCollection {
      commitContributionsByRepository {
        contributions(last: 10) {
          nodes {
            occurredAt
            commitCount
            repository {
              nameWithOwner
            }
          }
        }
      }
    }
  }
}

 

 

Copilot Lvl 2
Message 3 of 3

Re: List of repositories of the selected user (username string) has contributed (pull req, commit, e

thanks sir, this is what I need, gracias