Skip to content

Allow sorting by blocking issues and popularity via GraphQL API

What does this MR do?

Resolves #327243 (closed) and #327245 (closed).

For #327243 (closed)

  • Allow sorting issues by blocking issues count in asc/desc order.
  • Expose blocking_issues_count as blockingCount field on Issue type.

For #327245 (closed)

  • Allow sorting issues by popularity (upvotes) in asc/desc order.

Sample query

Sorting by blocking issues:

query {
  project(fullPath: "gitlab-org/gitlab") {
    issues(sort: BLOCKING_ISSUES_DESC) {
      nodes {
        id
        title
        blockingCount # newly added field
        blocked
        blockedByCount
      }
    }
  }
}

Sorting by popularity (upvoted):

query {
  project(fullPath: "gitlab-org/gitlab") {
    issues(sort: POPULARITY_DESC) {
      nodes {
        id
        title
        upvotes
      }
    }
  }
}

Conformity

Availability and Testing

Edited by euko

Merge request reports

Loading