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 'app/graphql/resolvers/ci/inherited_variables_resolver.rb')
-rw-r--r--app/graphql/resolvers/ci/inherited_variables_resolver.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/graphql/resolvers/ci/inherited_variables_resolver.rb b/app/graphql/resolvers/ci/inherited_variables_resolver.rb
index 01f966942a4..4e83265e247 100644
--- a/app/graphql/resolvers/ci/inherited_variables_resolver.rb
+++ b/app/graphql/resolvers/ci/inherited_variables_resolver.rb
@@ -5,8 +5,12 @@ module Resolvers
class InheritedVariablesResolver < BaseResolver
type Types::Ci::ProjectVariableType.connection_type, null: true
- def resolve
- object.group&.self_and_ancestors&.flat_map(&:variables) || []
+ argument :sort, Types::Ci::GroupVariablesSortEnum,
+ required: false, default_value: :created_desc,
+ description: 'Sort variables by the criteria.'
+
+ def resolve(sort:)
+ ::Ci::GroupVariablesFinder.new(object, sort).execute
end
end
end