Number of forks different in GraphQL x REST x Web UI


#1

ExpressJS has 6096 forks in GitHub’s Web UI.

But the response from the following GraphQL query is 5978.

query {
    repository (owner:"expressjs", name:"express") {
        forks {
             totalCount
        }
    } 
}

The REST API has the same number as the Web UI when I do a:

GET https://api.github.com/repos/expressjs/express

forks-rest

But when I get the actual forks, the count is a little different:

GET  https://api.github.com/repos/expressjs/express/forks

In the Link response header, the last page is numbered 200.

Link:
    <https://api.github.com/repositsories/237159/forks?page=2>; rel="next", 
    <https://api.github.com/repositories/237159/forks?page=200>; rel="last"

The last page has 29 fork objects in the payload. All the previous pages have 30 fork objects, which is the default pagination number.

So, we have: 199 * 30 + 29 = 5999 forks.

Why are those numbers different? What am I doing wrong?


#2

:wave: @alexandreaquiles, I don’t think you’re doing anything wrong, I suspect that you’ve found a bug. I’ve added this to our internal issue tracker to investigate.