简体   繁体   中英

GitHub GraphQL: Get all forks of a repository

I would like to get a list of all the forks (with timestamp) of a specific repository. When I try the following on explorer

{
  repository(name: "tensorflow", owner: "tensorflow") {
    forkCount
    forks(first: 100) {
      totalCount
    }
  }
}

It returns the forkCount correctly and as displayed on the webpage , but unexplainably there are over 15,000 fewer repositories in the "forks" list as displayed on the webpage and forkCount. Consequently, I am missing the timestamp for these repositories.

{
  "data": {
    "repository": {
      "forkCount": 86841,
      "forks": {
        "totalCount": 70082
      }
    }
  }
}

Does anyone have an explanation for this? How do you get the other repositories?

The visibility of a fork repository cannot be changed.

Thank you in advance!

forks.totalCount shows the number of direct forks of this repository. forkCount also includes forks of forks and this number may be bigger

Credit for the answer goes here: https://github.com/orgs/community/discussions/33375#discussioncomment-3671593

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM