Repository releases totalCount returns 0


#1

Just tried the GraphQL API explorer.

Not sure why, but it does not properly show angular’s total release count: there are 95 releases, but the query returns 0.

Query:

{
  angular: repository(owner: "angular", name: "angular") {
    releases {
      totalCount
    }
  }
}

Result:

{
  "data": {
    "angular": {
      "releases": {
        "totalCount": 0
      }
    }
  }
}

#2

You’re right! I’m logging a bug to track this one.


#3

Hi! Sorry for such a late reply on this, @MarkTiedemann.

Vanilla Git has the concept of tags, and tags can be one of two types: lightweight and annotated. Lightweight tags are basically just pointers to some Git object; annotated tags contain more information, such as the author of the tag, the name of the tag (v1, v1.0.1), and so on.

A “release” is something GitHub specific: it is an annotated tag that can contain a body (release notes), as well as assets (for example, builds of the project).

The UI considers “releases” to be “GitHub Releases” as well as “tags”.

As of now, we support the refs connection, which allows you to pass in the refPrefix to fetch what you need. For example:

{
  angular: repository(owner: "angular", name: "angular") {
    branches: refs(refPrefix:"refs/heads/") {
      totalCount
    }
    tags: refs(refPrefix:"refs/tags/") {
      totalCount
    }
    releases {
      totalCount
    }
  }
}

I hope that helps!


#4

I didn’t think of that! Many, many thanks, @gjtorikian, you saved my day! :smile:


#5

No problem! Fetching tags literally did not exist until this issue was opened. :laughing: