Skip to content

Add total count of project releases to GraphQL endpoint

What does this MR do?

Adds the ability to get the total number of releases associated to a project through GraphQL.

This is the final piece of info necessary to bring the GraphQL endpoint on par with the Release REST API.

This will unblock our efforts to convert the Releases page from the REST API to GraphQL: !33095 (merged)

Example query/response

Query:

{
  project(fullPath: "root/release-test") {
    releases(first: 1) {
      count
      nodes {
        name
        tagName
      }
    }
  }
}

Response:

{
  "data": {
    "project": {
      "releases": {
        "count": 38,
        "nodes": [
          {
            "name": "v1.2",
            "tagName": "v1.2",
            "description": ""
          }
        ]
      }
    }
  }
}

Permissions

The count field is available to anyone who has access to query the releases field, i.e:

  • everyone, if the project is public, or
  • Guest users and up, if the project is private.

Related to #214241 (closed)

Edited by Nathan Friend

Merge request reports