GraphQL API: add endpoint to return a list open merge requests that change a specific file

Previous investigation with a PoC: Spike: Provide a way to retrieve a list of open... (#469574 - closed)

Problem

We want to display a list of open merge requests for a file in a project. More details in When visiting a file (blob) page provide a way ... (#448868 - closed).

See a screenshot below.

Proposal

Add a GraphQL endpoint that returns a list of open merge requests for a requested file. See a PoC implementation: !162006 (closed).

Solution

{
  project(fullPath: "gitlab-org/gitlab-test") {
    id
    mergeRequests(state: opened, targetBranches: "master", blobPath: "Gemfile", createdAfter:"2024-12-01", first: 5) {
      nodes {
        iid
      }
    }
  }
}

Note For performance reasons frontend needs to provide createdAfter parameter with a request. The provided date should not be earlier than 30 days in the past.

Edited by Vasilii Iakliushin