Skip to content

Add `approved` filter to merge requests api

What does this MR do and why?

This adds the approved filter to the REST and GraphQL API.

Related to #3159

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

/api/v4/projects/gitlab-org%2Fgitlab-test/merge_requests?approved=no
/api/v4/projects/gitlab-org%2Fgitlab-test/merge_requests?approved=yes
query notApproved {
  project(fullPath: "gitlab-org/gitlab-test") {
    mergeRequests(approved: false) {
      count
      nodes {
        title
      }
    }
  }
}

query approved {
  project(fullPath: "gitlab-org/gitlab-test") {
    mergeRequests(approved: true) {
      count
      nodes {
        title
      }
    }
  }
}

MR acceptance checklist

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

Merge request reports