Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
bfb5044a
Commit
bfb5044a
authored
Nov 04, 2020
by
Pavel Shutsin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add epic filter for issues GraphQL
It can be used for Issues Analytics
parent
5f55a666
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
10 deletions
+79
-10
app/graphql/resolvers/concerns/issue_resolver_arguments.rb
app/graphql/resolvers/concerns/issue_resolver_arguments.rb
+1
-1
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+19
-4
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+34
-4
ee/app/graphql/ee/resolvers/issues_resolver.rb
ee/app/graphql/ee/resolvers/issues_resolver.rb
+4
-0
ee/spec/graphql/ee/resolvers/issues_resolver_spec.rb
ee/spec/graphql/ee/resolvers/issues_resolver_spec.rb
+21
-1
No files found.
app/graphql/resolvers/concerns/issue_resolver_arguments.rb
View file @
bfb5044a
...
...
@@ -29,7 +29,7 @@ module IssueResolverArguments
description:
'Usernames of users assigned to the issue'
argument
:assignee_id
,
GraphQL
::
STRING_TYPE
,
required:
false
,
description:
'ID of a user assigned to the issues, "none" and "any" values supported'
description:
'ID of a user assigned to the issues, "none" and "any" values
are
supported'
argument
:created_before
,
Types
::
TimeType
,
required:
false
,
description:
'Issues created before this date'
...
...
doc/api/graphql/reference/gitlab_schema.graphql
View file @
bfb5044a
...
...
@@ -8387,7 +8387,7 @@ type Group {
after
:
String
"""
ID
of
a
user
assigned
to
the
issues
,
"
none
"
and
"
any
"
values
supported
ID
of
a
user
assigned
to
the
issues
,
"
none
"
and
"
any
"
values
are
supported
"""
assigneeId
:
String
...
...
@@ -8431,6 +8431,11 @@ type Group {
"""
createdBefore
:
Time
"""
ID
of
an
epic
associated
with
the
issues
,
"
none
"
and
"
any
"
values
are
supported
"""
epicId
:
String
"""
Returns
the
first
_n_
elements
from
the
list
.
"""
...
...
@@ -14695,7 +14700,7 @@ type Project {
"""
issue
(
"""
ID
of
a
user
assigned
to
the
issues
,
"
none
"
and
"
any
"
values
supported
ID
of
a
user
assigned
to
the
issues
,
"
none
"
and
"
any
"
values
are
supported
"""
assigneeId
:
String
...
...
@@ -14734,6 +14739,11 @@ type Project {
"""
createdBefore
:
Time
"""
ID
of
an
epic
associated
with
the
issues
,
"
none
"
and
"
any
"
values
are
supported
"""
epicId
:
String
"""
IID
of
the
issue
.
For
example
,
"1"
"""
...
...
@@ -14795,7 +14805,7 @@ type Project {
"""
issueStatusCounts
(
"""
ID
of
a
user
assigned
to
the
issues
,
"
none
"
and
"
any
"
values
supported
ID
of
a
user
assigned
to
the
issues
,
"
none
"
and
"
any
"
values
are
supported
"""
assigneeId
:
String
...
...
@@ -14885,7 +14895,7 @@ type Project {
after
:
String
"""
ID
of
a
user
assigned
to
the
issues
,
"
none
"
and
"
any
"
values
supported
ID
of
a
user
assigned
to
the
issues
,
"
none
"
and
"
any
"
values
are
supported
"""
assigneeId
:
String
...
...
@@ -14929,6 +14939,11 @@ type Project {
"""
createdBefore
:
Time
"""
ID
of
an
epic
associated
with
the
issues
,
"
none
"
and
"
any
"
values
are
supported
"""
epicId
:
String
"""
Returns
the
first
_n_
elements
from
the
list
.
"""
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
bfb5044a
...
...
@@ -23095,7 +23095,7 @@
},
{
"name": "assigneeId",
"description": "ID of a user assigned to the issues, \"none\" and \"any\" values supported",
"description": "ID of a user assigned to the issues, \"none\" and \"any\" values
are
supported",
"type": {
"kind": "SCALAR",
"name": "String",
...
...
@@ -23225,6 +23225,16 @@
},
"defaultValue": null
},
{
"name": "epicId",
"description": "ID of an epic associated with the issues, \"none\" and \"any\" values are supported",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
},
{
"name": "includeSubgroups",
"description": "Include issues belonging to subgroups",
...
...
@@ -43209,7 +43219,7 @@
},
{
"name": "assigneeId",
"description": "ID of a user assigned to the issues, \"none\" and \"any\" values supported",
"description": "ID of a user assigned to the issues, \"none\" and \"any\" values
are
supported",
"type": {
"kind": "SCALAR",
"name": "String",
...
...
@@ -43338,6 +43348,16 @@
}
},
"defaultValue": null
},
{
"name": "epicId",
"description": "ID of an epic associated with the issues, \"none\" and \"any\" values are supported",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
}
],
"type": {
...
...
@@ -43448,7 +43468,7 @@
},
{
"name": "assigneeId",
"description": "ID of a user assigned to the issues, \"none\" and \"any\" values supported",
"description": "ID of a user assigned to the issues, \"none\" and \"any\" values
are
supported",
"type": {
"kind": "SCALAR",
"name": "String",
...
...
@@ -43653,7 +43673,7 @@
},
{
"name": "assigneeId",
"description": "ID of a user assigned to the issues, \"none\" and \"any\" values supported",
"description": "ID of a user assigned to the issues, \"none\" and \"any\" values
are
supported",
"type": {
"kind": "SCALAR",
"name": "String",
...
...
@@ -43783,6 +43803,16 @@
},
"defaultValue": null
},
{
"name": "epicId",
"description": "ID of an epic associated with the issues, \"none\" and \"any\" values are supported",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
},
{
"name": "after",
"description": "Returns the elements in the list that come after the specified cursor.",
ee/app/graphql/ee/resolvers/issues_resolver.rb
View file @
bfb5044a
...
...
@@ -10,6 +10,10 @@ module EE
argument
:iteration_id
,
::
GraphQL
::
ID_TYPE
.
to_list_type
,
required:
false
,
description:
'Iterations applied to the issue'
argument
:epic_id
,
GraphQL
::
STRING_TYPE
,
required:
false
,
description:
'ID of an epic associated with the issues, "none" and "any" values are supported'
end
private
...
...
ee/spec/graphql/ee/resolvers/issues_resolver_spec.rb
View file @
bfb5044a
...
...
@@ -7,7 +7,7 @@ RSpec.describe Resolvers::IssuesResolver do
let_it_be
(
:current_user
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
let_it_be
(
:project
)
{
create
(
:project
,
namespace:
group
,
skip_disk_validation:
true
)
}
context
"with a project"
do
describe
'#resolve'
do
...
...
@@ -72,6 +72,26 @@ RSpec.describe Resolvers::IssuesResolver do
expect
(
resolve_issues
(
iteration_id:
iteration1
.
id
)).
to
eq
[
issue_with_iteration
]
end
end
describe
'filter by epic'
do
let_it_be
(
:epic
)
{
create
:epic
,
group:
group
}
let_it_be
(
:epic2
)
{
create
:epic
,
group:
group
}
let_it_be
(
:issue1
)
{
create
:issue
,
project:
project
,
epic:
epic
}
let_it_be
(
:issue2
)
{
create
:issue
,
project:
project
,
epic:
epic2
}
let_it_be
(
:issue3
)
{
create
:issue
,
project:
project
}
it
'returns issues without epic when epic_id is "none"'
do
expect
(
resolve_issues
(
epic_id:
'none'
)).
to
match_array
([
issue3
])
end
it
'returns issues with any epic when epic_id is "any"'
do
expect
(
resolve_issues
(
epic_id:
'any'
)).
to
match_array
([
issue1
,
issue2
])
end
it
'returns issues with any epic when epic_id is specific'
do
expect
(
resolve_issues
(
epic_id:
epic
.
id
)).
to
match_array
([
issue1
])
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment