Add Issue.relatedMergeRequests to GraphQL API
What does this MR do and why?
This adds the ability to query the related merge requests for an issue.
Screenshots or screen recordings
How to set up and validate locally
Search an issue with related merge requests (or just mention some merge requests in a comment in that issue)
- Mention a Merge Request in an issue
- Execute the
relatedMrSingleIssue
query - Execute the
relatedMrMultiIssue
query and observe, that only one issue gets itsrelatedMergeRequests
value and the others get an error
query relatedMrSingleIssue {
project(fullPath: "<project-path>") {
issue(iid: "<issue-iid>") {
relatedMergeRequests {
count
nodes {
title
project {
fullPath
}
reference
}
}
}
}
}
query relatedMrMultiIssue {
project(fullPath: "gitlab-org/gitlab-test") {
issues {
nodes {
relatedMergeRequests {
count
nodes {
title
project {
fullPath
}
reference
}
}
}
}
}
}
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Niklas van Schrick