GraphQL API returns wrong releases


#1

I am trying to get the total count of releases in my repository via GraphQL API with the following query:

{
  repository(owner: "akshaybabloo", name: "gollahalli-com") {
    releases {
      totalCount
    }
  }
}

and this returns

{
  "data": {
    "repository": {
      "releases": {
        "totalCount": 51
      }
    }
  }
}

But I have 53 releases in https://github.com/akshaybabloo/gollahalli-com.


#2

Hey @akshaybabloo

I was able to reproduce this on one of my own repositories. I’ve opened an issue internally to look into the discrepancy. We’ll let you know once we’ve learned more.


#3

I was looking at this before because someone else was having this issue (See last post of this). It don’t know much of how git works, but there seems to be a difference between a GitHub release and a plain git tag release.

For example, using your akshaybabloo/gollahalli-com repo:

{
  repository(owner: "akshaybabloo", name: "gollahalli-com") {
    refs(refPrefix:"refs/tags/"){
      totalCount
    }
    releases {
      totalCount
    }
  }
}

will return

{
  "data": {
    "repository": {
      "refs": {
        "totalCount": 53
      },
      "releases": {
        "totalCount": 51
      }
    }
  }
}

You can also visually see the difference between them on the repo’s releases page:

If you scroll through the releases page, you will see that only v2.0.11 and v2.0.3 will display the time on the left side instead of the tag and commit.


#4

Thanks, @LizzHale.

@Andoryuuta Ya that’s what I was looking for. I think GitHub Should document it.