Skip to content

Create branchRuleUpdate graphql mutation

Gavin Hinfey requested to merge 431918-build-editbranchrule-mutation into master

What does this MR do and why?

Adds a graphql mutation branchRuleUpdate which allows a project maintainer and above to update a branch rule with a name argument.

How to set up and validate locally

On the GDK visit http://[yourlocalhost]/-/graphql-explorer and run the query below.

Query

mutation {
  branchRuleUpdate(input: {
    id: "gid://gitlab/ProtectedBranch/8"
    projectPath: "twitter/Typeahead.Js",
    name: "staging/*"
  }) {
    branchRule { # type is https://docs.gitlab.com/ee/api/graphql/reference/#branchrule
      name
    }
    errors
  }
}

Expected result

{
  "data": {
    "branchRuleUpdate": {
      "branchRule": {
        "name": "staging/*"
      },
      "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 #431918 (closed)

Edited by Gavin Hinfey

Merge request reports