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

Get contributor count with the graphql api

Hi,

 

Is it possible to get a total contributor count from a repository, as is displayed at the top of the repository, with the graphql api?

 

I was able to retrieve all commits and get the author, but I can't compute a count through that endpoint or get a total count through the repository object.

 

2 Replies
Community Manager
Message 2 of 3

Re: Get contributor count with the graphql api

Hi @acrobat,

 

Thanks for being here! As of now, you might get the total count of commits ie:

query {
  repository(owner:"rails", name:"rails") {
    object(expression:"master") {
      ... on Commit {
        history {
          totalCount
        }
      }
    }
  }
}

 

A schema has been requested to get the total contributor numbers and is a work in progress, I'll do some more digging and post any other updates here.

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Highlighted
Copilot Lvl 2
Message 3 of 3

Re: Get contributor count with the graphql api

Hi @AndreaGriffiths11, That's indeed the graphql query I use to get the commit count. Thanks for requesting the schema change, I will wait for an update when this is available!