Add the `draft` argument to GraphQL MergeRequestsResolver
What does this MR do and why?
This also makes the MergeRequestsFinder
more robust by converting the draft
/wip
params value to a boolean.
This is needed for gitlab-org/ruby/gems/gitlab-triage#253 (closed).
Screenshots or screen recordings
No draft param |
draft: true |
draft: false |
---|---|---|
How to set up and validate locally
- Ensure a MR is in draft in the
gitlab-org/gitlab-test
project - Visit http://gdk.test:3000/-/graphql-explorer (or your own local URL of the GraphQL explorer
- Try the following 3 queries and check the results:
- No
draft
param => results should include draft & non-draft MRs:
{
project(fullPath: "gitlab-org/gitlab-test") {
id
mergeRequests(state: opened) {
pageInfo {
hasNextPage
endCursor
}
nodes {
id
iid
title
state
webUrl
targetBranch
draft
}
}
}
}
-
draft: true
param => results should only include draft MRs:
{
project(fullPath: "gitlab-org/gitlab-test") {
id
mergeRequests(draft: true, state: opened) {
pageInfo {
hasNextPage
endCursor
}
nodes {
id
iid
title
state
webUrl
targetBranch
draft
}
}
}
}
-
draft: false
param => results should include non-draft MRs:
{
project(fullPath: "gitlab-org/gitlab-test") {
id
mergeRequests(draft: false, state: opened) {
pageInfo {
hasNextPage
endCursor
}
nodes {
id
iid
title
state
webUrl
targetBranch
draft
}
}
}
}
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 Rémy Coutable