Skip to content

Set required nullable for weight argument

euko requested to merge 362550-allow-null-for-wi-weight-mutation into master

What does this MR do and why?

  1. Update Mutations::Issues::SetWeight to use required: nullable for its argument.
  2. Update WeightInputType to use required: nullable (this change is behind a FF that's not defaulted.)

How to set up and validate locally

Create a new issue and note its id and iid.

Test Mutations::Issues::SetWeight

For `Mutations::Issues::SetWeight`, execute the following mutations with different `weight` values including `null`.
mutation {
  issueSetWeight(input: {projectPath: "root-group/root-project-1", iid: "17", weight: 100}) {
    issue {
      iid
      weight
    }
  }
}

Test WeightInputType

Enable :work_items FF

Feature.enable(:work_items)

Use this sample mutation with different weight values including null.

If your issue has id=460, use "gid://gitlab/WorkItem/460" as the gid (this is because work item is practically an alias for issue at this point.)

mutation {
  workItemUpdate(
    input: {id: "gid://gitlab/WorkItem/460", weightWidget: {weight: null}}
  ) {
    workItem {
      id
      title
      widgets {
        ... on WorkItemWidgetWeight {
          weight
        }
      }
    }
    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.

Related to #362550 (closed)

Edited by euko

Merge request reports

Loading