Release Count Does Not Match What Is Shown On Repository Page


#1

When I run the following I was expecting to have to paginate and make 3 total requests. One for 1-100, 101-201, 202-209 as the repository page says there are 209 releases. However, I get a totalCount of 168. Am I missing something obvious in my query such that it won’t fetch all releases, or is this a bug?

 {
      repository(name: "vue", owner: "vuejs") {
        releases(first: 100) {
          totalCount
          nodes {
            name
          }
          pageInfo {
            endCursor
            hasNextPage
          }
        }
      }
    }

#2

The release page on Github does not show only releases. It also shows tags. If you want the count to match up you have to query the tags:

query {
  repository(owner: "vuejs", name: "vue") {
    tags: refs(refPrefix: "refs/tags/", first: 100, after: "MDM6UmVmMzc0OTI3Ok9UUC0xNy4x", direction: ASC) {
      totalCount
    }
  }
}

If you want the release metadata included, this is more tricky.

I have been tackling this issue for a while and the only thing you can do is get the tags and then merge it with the releases to get rid of the duplicates. I asked a similar question: