Skip to content

Fix labels N + 1 query in WorkItemsResolver

Mario Celi requested to merge 339756-fix-n+1 into master

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.

Related to #339756 (closed)

Merge request reports

Loading