Skip to content

[GQL] Add author and merged-at fields to MergeRequest type

Alex Kalderimis requested to merge ajk-gql-add-mr-author into master

What does this MR do?

Addresses #217475 (closed)

This adds missing features that prevent replacing uses of the REST API with GraphQL. These include:

  • author field in MergeRequest type
  • mergedAt field in MergeRequest type

Example GraphQL queries

query {
  project(fullPath: "gitlab-org/gitlab-test") {
    mergeRequests {
      nodes {
        title
        mergedAt
        author { username }
      }
    }
  }
}

Example GraphQL responses

{
  "data": {
    "project": {
      "mergeRequests": {
        "nodes": [
          {
            "title": "Cannot be automatically merged",
            "mergedAt": null,
            "author": {
              "username": "root"
            }
          },
          {
            "title": "Can be automatically merged",
            "mergedAt": null,
            "author": {
              "username": "root"
            }
          },
          ...
        ]
      }
    }
  }
}

Screenshots

Demonstrating use of new filters and fields

1588602982

1588603377

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Alex Kalderimis

Merge request reports