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
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/graphql/connections/filterable_array_connection.rb')
-rw-r--r--lib/gitlab/graphql/connections/filterable_array_connection.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/gitlab/graphql/connections/filterable_array_connection.rb b/lib/gitlab/graphql/connections/filterable_array_connection.rb
new file mode 100644
index 00000000000..251bcd9343b
--- /dev/null
+++ b/lib/gitlab/graphql/connections/filterable_array_connection.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module Graphql
+ module Connections
+ class FilterableArrayConnection < GraphQL::Relay::ArrayConnection
+ def paged_nodes
+ @authorized_nodes ||= begin
+ callback = nodes.filter_callback
+ callback.call(super)
+ end
+ end
+ end
+ end
+ end
+end