diff options
Diffstat (limited to 'app/graphql/resolvers/project_packages_resolver.rb')
-rw-r--r-- | app/graphql/resolvers/project_packages_resolver.rb | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/app/graphql/resolvers/project_packages_resolver.rb b/app/graphql/resolvers/project_packages_resolver.rb index 288e14b41d0..6d66c2fe460 100644 --- a/app/graphql/resolvers/project_packages_resolver.rb +++ b/app/graphql/resolvers/project_packages_resolver.rb @@ -1,19 +1,15 @@ # frozen_string_literal: true +# rubocop: disable Graphql/ResolverType module Resolvers - class ProjectPackagesResolver < BaseResolver - type Types::Packages::PackageType.connection_type, null: true + class ProjectPackagesResolver < PackagesBaseResolver + # The GraphQL type is defined in the extended class - def resolve(**args) + def resolve(sort:, **filters) return unless packages_available? - ::Packages::PackagesFinder.new(object).execute - end - - private - - def packages_available? - ::Gitlab.config.packages.enabled + ::Packages::PackagesFinder.new(object, filters.merge(SORT_TO_PARAMS_MAP.fetch(sort))).execute end end end +# rubocop: enable Graphql/ResolverType |