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
2bbeabc2
Commit
2bbeabc2
authored
May 06, 2020
by
Brett Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return all nodes since pagination is external
Regression introduced when moved to newer GraphQL pagination classes
parent
f17db538
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
changelogs/unreleased/216851-graphql-externallypaginatedarrayconnection-can-return-incorrect-nu.yml
...nallypaginatedarrayconnection-can-return-incorrect-nu.yml
+5
-0
lib/gitlab/graphql/pagination/externally_paginated_array_connection.rb
...aphql/pagination/externally_paginated_array_connection.rb
+14
-0
spec/lib/gitlab/graphql/pagination/externally_paginated_array_connection_spec.rb
.../pagination/externally_paginated_array_connection_spec.rb
+14
-0
No files found.
changelogs/unreleased/216851-graphql-externallypaginatedarrayconnection-can-return-incorrect-nu.yml
0 → 100644
View file @
2bbeabc2
---
title
:
Fix incorrect number of errors returned when querying sentry errors
merge_request
:
31252
author
:
type
:
fixed
lib/gitlab/graphql/pagination/externally_paginated_array_connection.rb
View file @
2bbeabc2
...
@@ -23,6 +23,20 @@ module Gitlab
...
@@ -23,6 +23,20 @@ module Gitlab
alias_method
:has_next_page
,
:next_page?
alias_method
:has_next_page
,
:next_page?
alias_method
:has_previous_page
,
:previous_page?
alias_method
:has_previous_page
,
:previous_page?
private
def
load_nodes
@nodes
||=
begin
# As the pagination happens externally we just grab all the nodes
limited_nodes
=
items
limited_nodes
=
limited_nodes
.
first
(
first
)
if
first
limited_nodes
=
limited_nodes
.
last
(
last
)
if
last
limited_nodes
end
end
end
end
end
end
end
end
...
...
spec/lib/gitlab/graphql/pagination/externally_paginated_array_connection_spec.rb
View file @
2bbeabc2
...
@@ -19,6 +19,20 @@ describe Gitlab::Graphql::Pagination::ExternallyPaginatedArrayConnection do
...
@@ -19,6 +19,20 @@ describe Gitlab::Graphql::Pagination::ExternallyPaginatedArrayConnection do
it_behaves_like
'connection with paged nodes'
do
it_behaves_like
'connection with paged nodes'
do
let
(
:paged_nodes_size
)
{
values
.
size
}
let
(
:paged_nodes_size
)
{
values
.
size
}
end
end
context
'when after or before is specified, they are ignored'
do
# after and before are not used to filter the array, as they
# were already used to directly fetch the external array
it_behaves_like
'connection with paged nodes'
do
let
(
:arguments
)
{
{
after:
next_cursor
}
}
let
(
:paged_nodes_size
)
{
values
.
size
}
end
it_behaves_like
'connection with paged nodes'
do
let
(
:arguments
)
{
{
before:
prev_cursor
}
}
let
(
:paged_nodes_size
)
{
values
.
size
}
end
end
end
end
describe
'#start_cursor'
do
describe
'#start_cursor'
do
...
...
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