Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-15 18:49:40 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-15 18:49:40 +0300
commitb04b1e12c5847f7d366e08af47115d985b73e185 (patch)
tree5077e33eedbf1e99b9ef9b87395f9acce844b234 /lib
parenta5b9fb9abc2b83304f45392642801b28f52b3f48 (diff)
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/graphql/pagination/externally_paginated_array_connection.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/graphql/pagination/externally_paginated_array_connection.rb b/lib/gitlab/graphql/pagination/externally_paginated_array_connection.rb
index 1f01dd07571..12e047420bf 100644
--- a/lib/gitlab/graphql/pagination/externally_paginated_array_connection.rb
+++ b/lib/gitlab/graphql/pagination/externally_paginated_array_connection.rb
@@ -23,6 +23,20 @@ module Gitlab
alias_method :has_next_page, :next_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