debian-mirror-gitlab/app/graphql/resolvers/project_packages_resolver.rb
2022-07-17 14:43:12 +02:00

18 lines
496 B
Ruby

# frozen_string_literal: true
# rubocop: disable Graphql/ResolverType
module Resolvers
class ProjectPackagesResolver < PackagesBaseResolver
# The GraphQL type is defined in the extended class
def resolve(sort:, **filters)
return unless packages_available?
params = filters.merge(SORT_TO_PARAMS_MAP.fetch(sort))
params[:preload_pipelines] = false
::Packages::PackagesFinder.new(object, params).execute
end
end
end
# rubocop: enable Graphql/ResolverType