Commit 2b40b207 authored by Mark Chao's avatar Mark Chao

Merge branch 'kassio/add-include_descendant_groups-to-epics-graphql' into 'master'

Add `include_descendant_groups` to Epics GraphQL

See merge request gitlab-org/gitlab!46711
parents eb361d20 c471f388
......@@ -1439,6 +1439,11 @@ type BoardEpic implements CurrentUserTodos & Noteable {
"""
iids: [ID!]
"""
Include epics from descendant groups
"""
includeDescendantGroups: Boolean = true
"""
Filter epics by labels
"""
......@@ -6592,6 +6597,11 @@ type Epic implements CurrentUserTodos & Noteable {
"""
iids: [ID!]
"""
Include epics from descendant groups
"""
includeDescendantGroups: Boolean = true
"""
Filter epics by labels
"""
......@@ -8166,6 +8176,11 @@ type Group {
"""
iids: [ID!]
"""
Include epics from descendant groups
"""
includeDescendantGroups: Boolean = true
"""
Filter epics by labels
"""
......@@ -8249,6 +8264,11 @@ type Group {
"""
iids: [ID!]
"""
Include epics from descendant groups
"""
includeDescendantGroups: Boolean = true
"""
Filter epics by labels
"""
......
......@@ -3867,6 +3867,16 @@
},
"defaultValue": null
},
{
"name": "includeDescendantGroups",
"description": "Include epics from descendant groups",
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"defaultValue": "true"
},
{
"name": "after",
"description": "Returns the elements in the list that come after the specified cursor.",
......@@ -18288,6 +18298,16 @@
},
"defaultValue": null
},
{
"name": "includeDescendantGroups",
"description": "Include epics from descendant groups",
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"defaultValue": "true"
},
{
"name": "after",
"description": "Returns the elements in the list that come after the specified cursor.",
......@@ -22575,6 +22595,16 @@
"ofType": null
},
"defaultValue": null
},
{
"name": "includeDescendantGroups",
"description": "Include epics from descendant groups",
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"defaultValue": "true"
}
],
"type": {
......@@ -22725,6 +22755,16 @@
},
"defaultValue": null
},
{
"name": "includeDescendantGroups",
"description": "Include epics from descendant groups",
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"defaultValue": "true"
},
{
"name": "after",
"description": "Returns the elements in the list that come after the specified cursor.",
......@@ -41,6 +41,11 @@ module Resolvers
required: false,
description: 'Filter epics by iid for autocomplete'
argument :include_descendant_groups, GraphQL::BOOLEAN_TYPE,
required: false,
description: 'Include epics from descendant groups',
default_value: true
type Types::EpicType, null: true
def ready?(**args)
......
---
title: Add `include_descendant_groups` option to Epics GraphQL API
merge_request: 46711
author:
type: changed
......@@ -200,11 +200,15 @@ RSpec.describe Resolvers::EpicsResolver do
expect(resolve_epics(iids: iids)).to contain_exactly(epic1, epic2)
end
it 'return all epics' do
it 'returns all epics' do
expect(resolve_epics).to contain_exactly(epic1, epic2, epic3, epic4)
end
it 'filter by milestones in subgroups' do
it 'does not return subgroup epics when include_descendant_groups is false' do
expect(resolve_epics(include_descendant_groups: false)).to contain_exactly(epic1, epic2)
end
it 'filters by milestones in subgroups' do
subgroup_project = create(:project, group: sub_group)
milestone = create(:milestone, group: sub_group)
create(:issue, project: subgroup_project, epic: epic1, milestone: milestone)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment