Add workItemsStateCount field to namespace type

What does this MR do and why?

This MR adds the workItemsStateCount field to the namespace GQL type, as a follow up to #537460 (closed). The aim is to allow the frontend to request the state counts without needing to differentiate whether the request should be made under group.workItemStateCounts or project.workItemStateCounts.

References

Screenshots or screen recordings

Not provided

How to set up and validate locally

  1. In an environment with the GDK running, navigate to http://localhost:3000/-/graphql-explorer
  2. Write a query which fetches workItemStateCounts for groups, projects, and namespaces simultaneously. To simplify testing, I also pulled the fullPath out into a variable. i.e:

Query:

query q($fullPath: ID!) {
  namespace(fullPath: $fullPath) {
    workItemStateCounts { all closed opened}
  }
  group(fullPath: $fullPath) {
    workItemStateCounts { all closed opened}
  }
  project(fullPath: $fullPath) {
    workItemStateCounts { all closed opened}
  }
}

Variables:

{ "fullPath": "flightjs/flight" }
  1. Run the query, updating the fullPath variable to the path of a group, subgroup, project and user namespace. You should observe:
  • When called on a group, the counts for group.workItemStateCounts should match namespace.workItemStateCounts
  • When called on a subgroup, the counts for group.workItemStateCounts should match namespace.workItemStateCounts
  • When called on a project, the counts for project.workItemStateCounts should match namespace.workItemStateCounts
  • When called on a user namespace, null should be returned for all of the counts (unsupported)

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #550033 (closed)

Edited by Matt D'Angelo

Merge request reports

Loading