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
- In an environment with the GDK running, navigate to
http://localhost:3000/-/graphql-explorer - Write a query which fetches
workItemStateCountsfor groups, projects, and namespaces simultaneously. To simplify testing, I also pulled thefullPathout 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" }
- Run the query, updating the
fullPathvariable to the path of a group, subgroup, project and user namespace. You should observe:
- When called on a group, the counts for
group.workItemStateCountsshould matchnamespace.workItemStateCounts - When called on a subgroup, the counts for
group.workItemStateCountsshould matchnamespace.workItemStateCounts - When called on a project, the counts for
project.workItemStateCountsshould matchnamespace.workItemStateCounts - When called on a user namespace,
nullshould 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