2020-07-17 02:09:11 -04:00
|
|
|
# frozen_string_literal: true
|
2021-05-13 11:10:20 -04:00
|
|
|
# rubocop: disable Graphql/ResolverType
|
2020-07-17 02:09:11 -04:00
|
|
|
|
|
|
|
module Resolvers
|
2021-05-13 11:10:20 -04:00
|
|
|
class ProjectPackagesResolver < PackagesBaseResolver
|
|
|
|
# The GraphQL type is defined in the extended class
|
2020-07-17 02:09:11 -04:00
|
|
|
|
2021-05-13 11:10:20 -04:00
|
|
|
def resolve(sort:, **filters)
|
2020-07-17 02:09:11 -04:00
|
|
|
return unless packages_available?
|
|
|
|
|
2022-05-03 14:07:53 -04:00
|
|
|
params = filters.merge(SORT_TO_PARAMS_MAP.fetch(sort))
|
|
|
|
params[:preload_pipelines] = false
|
|
|
|
|
|
|
|
::Packages::PackagesFinder.new(object, params).execute
|
2020-07-17 02:09:11 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2021-05-13 11:10:20 -04:00
|
|
|
# rubocop: enable Graphql/ResolverType
|