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
ad51968c
Commit
ad51968c
authored
Aug 07, 2020
by
charlie ablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try offset pagination again
parent
693d3c8d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
app/graphql/resolvers/board_list_issues_resolver.rb
app/graphql/resolvers/board_list_issues_resolver.rb
+1
-3
app/graphql/types/issuable_connection_type.rb
app/graphql/types/issuable_connection_type.rb
+4
-0
spec/graphql/resolvers/board_list_issues_resolver_spec.rb
spec/graphql/resolvers/board_list_issues_resolver_spec.rb
+1
-1
No files found.
app/graphql/resolvers/board_list_issues_resolver.rb
View file @
ad51968c
...
...
@@ -7,10 +7,8 @@ module Resolvers
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
(
"issues.relative_position ASC, issues.id DESC"
)
# rubocop: enable CodeReuse/ActiveRecord
Gitlab
::
Graphql
::
Pagination
::
OffsetActiveRecordRelationConnection
.
new
(
service
.
execute
)
end
end
end
app/graphql/types/issuable_connection_type.rb
View file @
ad51968c
...
...
@@ -7,7 +7,11 @@ module Types
description:
'Total count of collection'
def
count
# rubocop: disable CodeReuse/ActiveRecord
relation
=
object
.
items
# sometimes relation is an Array
relation
=
relation
.
reorder
(
nil
)
if
relation
.
respond_to?
(
:reorder
)
# rubocop: enable CodeReuse/ActiveRecord
if
relation
.
try
(
:group_values
)
&
.
present?
relation
.
size
.
keys
.
size
...
...
spec/graphql/resolvers/board_list_issues_resolver_spec.rb
View file @
ad51968c
...
...
@@ -27,7 +27,7 @@ RSpec.describe Resolvers::BoardListIssuesResolver do
issue3
=
create
(
:issue
,
project:
project
,
labels:
[
label
],
relative_position:
10
)
# by relative_position and then ID
issues
=
resolve_board_list_issues
issues
=
resolve_board_list_issues
.
items
expect
(
issues
.
map
(
&
:id
)).
to
eq
[
issue3
.
id
,
issue1
.
id
,
issue2
.
id
]
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