Add UserAddOnAssignmentBulkRemove Mutation
What does this MR do and why?
-
Add
UserAddOnAssignmentBulkRemove
Mutation -
Add the bulk remove service
Related to #442285 and https://gitlab.com/gitlab-org/gitlab/-/issues/442286
The Approach here is either All-in
or None
.
If NO_ASSIGNMENTS_FOUND
we don't do any bulk un-assignments, if not, we do bulk un-assignments.
Mutation Example:
NO_ASSIGNMENTS_FOUND Error
mutation {
userAddOnAssignmentBulkRemove(
input: {userIds: ["gid://gitlab/User/500"], addOnPurchaseId: "gid://gitlab/GitlabSubscriptions::AddOnPurchase/6"}
) {
addOnPurchase {
id
}
users {
edges {
node {
id
name
username
}
}
}
errors
}
}
Response
SUCCESS
mutation {
userAddOnAssignmentBulkRemove(
input: {userIds: ["gid://gitlab/User/13", "gid://gitlab/User/19", "gid://gitlab/User/20"], addOnPurchaseId: "gid://gitlab/GitlabSubscriptions::AddOnPurchase/6"}
) {
addOnPurchase {
id
}
users {
edges {
node {
id
name
username
}
}
}
errors
}
}
Response
Related to #442285
Edited by Mohamed Hamda