Skip to content

Add issuable state count type for Project graphql

Sean Arnold requested to merge 232580-issue-state-counts-graphql into master

What does this MR do?

This adds the issue_status_counts field to Project, which provides the ability to fetch the counts of issues for each status (Closed, open, all) via GraphQL.

It re-uses the Issues resolver arguments which allows the issue status counts to be filtered in the same way that issues are. To do this, I moved the resolver arguments into a shared file and prepended them into the resolvers.

An example query & response is:

{
  project(fullPath: "root/autodevops-deploy") {
    issueStatusCounts(search:"error") {
      all
      closed
      opened
    }
  }
}
{
  "data": {
    "project": {
      "issueStatusCounts": {
        "all": 129,
        "closed": 20,
        "opened": 109
      }
    }
  }
}

Does this MR meet the acceptance criteria?

Conformity

Closes #232580 (closed)

Edited by Sean Arnold

Merge request reports