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
73540f95
Commit
73540f95
authored
Jul 07, 2020
by
charlieablett
Committed by
charlie ablett
Aug 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GraphQL expose issues under board list
- Add test
parent
5f2283ed
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
99 additions
and
1 deletion
+99
-1
app/graphql/resolvers/board_list_issues_resolver.rb
app/graphql/resolvers/board_list_issues_resolver.rb
+16
-0
app/graphql/types/board_list_type.rb
app/graphql/types/board_list_type.rb
+4
-0
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+25
-0
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+53
-0
spec/graphql/types/board_list_type_spec.rb
spec/graphql/types/board_list_type_spec.rb
+1
-1
No files found.
app/graphql/resolvers/board_list_issues_resolver.rb
0 → 100644
View file @
73540f95
# frozen_string_literal: true
module
Resolvers
class
BoardListIssuesResolver
<
BaseResolver
type
Types
::
IssueType
,
null:
true
alias_method
:list
,
:object
def
resolve
(
**
args
)
# rubocop: disable CodeReuse/ActiveRecord
service
=
Boards
::
Issues
::
ListService
.
new
(
list
.
board
.
resource_parent
,
context
[
:current_user
],
{
board_id:
list
.
board
.
id
,
id:
list
.
id
})
service
.
execute
.
reorder
(
"relative_position ASC"
)
# rubocop: enable CodeReuse/ActiveRecord
end
end
end
app/graphql/types/board_list_type.rb
View file @
73540f95
...
@@ -19,6 +19,10 @@ module Types
...
@@ -19,6 +19,10 @@ module Types
field
:collapsed
,
GraphQL
::
BOOLEAN_TYPE
,
null:
true
,
field
:collapsed
,
GraphQL
::
BOOLEAN_TYPE
,
null:
true
,
description:
'Indicates if list is collapsed for this user'
,
description:
'Indicates if list is collapsed for this user'
,
resolve:
->
(
list
,
_args
,
ctx
)
{
list
.
collapsed?
(
ctx
[
:current_user
])
}
resolve:
->
(
list
,
_args
,
ctx
)
{
list
.
collapsed?
(
ctx
[
:current_user
])
}
field
:issues
,
::
Types
::
IssueType
.
connection_type
,
null:
true
,
description:
'Board issues'
,
resolver:
::
Resolvers
::
BoardListIssuesResolver
end
end
# rubocop: enable Graphql/AuthorizeTypes
# rubocop: enable Graphql/AuthorizeTypes
end
end
...
...
doc/api/graphql/reference/gitlab_schema.graphql
View file @
73540f95
...
@@ -1087,6 +1087,31 @@ type BoardList {
...
@@ -1087,6 +1087,31 @@ type BoardList {
"""
"""
id
:
ID
!
id
:
ID
!
"""
Board
issues
"""
issues
(
"""
Returns
the
elements
in
the
list
that
come
after
the
specified
cursor
.
"""
after
:
String
"""
Returns
the
elements
in
the
list
that
come
before
the
specified
cursor
.
"""
before
:
String
"""
Returns
the
first
_n_
elements
from
the
list
.
"""
first
:
Int
"""
Returns
the
last
_n_
elements
from
the
list
.
"""
last
:
Int
):
IssueConnection
"""
"""
Label
of
the
list
Label
of
the
list
"""
"""
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
73540f95
...
@@ -2927,6 +2927,59 @@
...
@@ -2927,6 +2927,59 @@
"isDeprecated": false,
"isDeprecated": false,
"deprecationReason": null
"deprecationReason": null
},
},
{
"name": "issues",
"description": "Board issues",
"args": [
{
"name": "after",
"description": "Returns the elements in the list that come after the specified cursor.",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
},
{
"name": "before",
"description": "Returns the elements in the list that come before the specified cursor.",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
},
{
"name": "first",
"description": "Returns the first _n_ elements from the list.",
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
},
"defaultValue": null
},
{
"name": "last",
"description": "Returns the last _n_ elements from the list.",
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
},
"defaultValue": null
}
],
"type": {
"kind": "OBJECT",
"name": "IssueConnection",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
{
"name": "label",
"name": "label",
"description": "Label of the list",
"description": "Label of the list",
spec/graphql/types/board_list_type_spec.rb
View file @
73540f95
...
@@ -6,7 +6,7 @@ RSpec.describe GitlabSchema.types['BoardList'] do
...
@@ -6,7 +6,7 @@ RSpec.describe GitlabSchema.types['BoardList'] do
specify
{
expect
(
described_class
.
graphql_name
).
to
eq
(
'BoardList'
)
}
specify
{
expect
(
described_class
.
graphql_name
).
to
eq
(
'BoardList'
)
}
it
'has specific fields'
do
it
'has specific fields'
do
expected_fields
=
%w[id list_type position label]
expected_fields
=
%w[id list_type position label
issues
]
expect
(
described_class
).
to
include_graphql_fields
(
*
expected_fields
)
expect
(
described_class
).
to
include_graphql_fields
(
*
expected_fields
)
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