Fix labels N + 1 query in WorkItemsResolver
What does this MR do and why?
Fixes a possible N+1 query when fetching a work item's labels through the widget interface using a query like:
{
workItem(id: "gid://gitlab/WorkItem/47") {
widgets {
type
... on WorkItemWidgetLabels {
labels {
nodes {
id
title
}
}
}
}
}
}
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #339756 (closed)