Add ability to remove a work item's parent with GraphQL
What does this MR do and why?
This is the third task needed for #362213 (closed).
Depends on the previous task being completed: GraphQL: Add hierarchyWidget to work item updat... (!90908 - merged)
Adds the option to pass null
to parentId
argument in WorkItemUpdate
mutation. This action will remove the parent of a given work item. This is done through the input hierarchyWidget
.
How to set up and validate locally
-
Enable
:work_items
andwork_items_hierarchy
feature flagsFeature.enable(:work_items) Feature.enable(:work_items_hierarchy)
-
Run GraphQL query with
http://local-url/-/graphql-explorer
removeParent
mutation removeParent {
workItemUpdate(input: { id: "gid://gitlab/Issue/{ISSUE_ID}" , hierarchyWidget: { parentId: null }}) {
workItem {
id
widgets {
... on WorkItemWidgetHierarchy {
parent {
id
}
}
}
}
errors
}
}
- The response should return
null
for parent:
example response
{
"data": {
"workItemUpdate": {
"workItem": {
"id": "gid://gitlab/WorkItem/1688",
"widgets": [
{},
{},
{
"parent": null
},
{}
]
},
"errors": []
}
}
}
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 #362213 (closed)
Edited by Eugenia Grieff