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

Get contributor count with the graphql api

Solved! Go to Solution.

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.

 

5 Replies
Solution
Community Manager
Message 2 of 6

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.


Best,
AndreaG

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

Copilot Lvl 3
Message 3 of 6

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!

Copilot Lvl 3
Message 4 of 6

Re: Get contributor count with the graphql api

@AndreaGriffiths11 any update on status of a contributor count value in graphql?

Copilot Lvl 2
Message 5 of 6

Re: Get contributor count with the graphql api

Battling the same need myself.  Hoping to see a commit/history/totalContributors or something like that.

Ground Controller Lvl 1
Message 6 of 6

Re: Get contributor count with the graphql api

Do you have any sample code to display?