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

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

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
            }
          }
        }
      }
    }
  }
}
2 Likes

thanks sir, this is what I need, gracias