Add hasChildren field to work items hierarchy widget
requested to merge 383538-okr-for-gitlab-expose-haschildren-field-for-work-items-hierarchy-widget into master
Related to #383538 (closed)
What does this MR do and why?
Adds a new field to work items hierarchy widgets that indicates if the work item has children.
Example query:
query {
workItem(id: "gid://gitlab/Issue/113355760") {
widgets {
... on WorkItemWidgetHierarchy {
hasChildren
}
}
}
}
example response
{
"data": {
"workItem": {
"widgets": [
{},
{},
{},
{},
{},
{
"hasChildren": true
},
{},
{},
{}
]
}
}
}
This new field uses BatchLoader::GraphQL
to batch results for multiple work items with the following query:
SELECT "work_item_parent_links"."work_item_parent_id"
FROM "work_item_parent_links"
WHERE "work_item_parent_links"."work_item_parent_id" IN (115219866, 113355760)
GROUP BY "work_item_parent_links"."work_item_parent_id"
Query plan (internal): https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/13644/commands/47894
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.
Edited by Eugenia Grieff