Skip to content

CreateBranchRule GraphQL mutation

Patrick Cyiza requested to merge 431910-build-createbranchrule-gql-mutation into master

What does this MR do and why?

It creates a branch rule associated with a protected branch with the name and the project_path argument.

Screenshots or screen recordings

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

How to set up and validate locally

Visite http://[yourlocalhost]/-/graphql-explorer and try out the query above.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Closes #431910 (closed)

Edited by Patrick Cyiza

Merge request reports