debian-mirror-gitlab/app/graphql/resolvers/project_packages_resolver.rb

16 lines
432 B
Ruby
Raw Normal View History

2020-07-28 23:09:34 +05:30
# frozen_string_literal: true
2021-06-08 01:23:25 +05:30
# rubocop: disable Graphql/ResolverType
2020-07-28 23:09:34 +05:30
module Resolvers
2021-06-08 01:23:25 +05:30
class ProjectPackagesResolver < PackagesBaseResolver
# The GraphQL type is defined in the extended class
2020-07-28 23:09:34 +05:30
2021-06-08 01:23:25 +05:30
def resolve(sort:, **filters)
2020-07-28 23:09:34 +05:30
return unless packages_available?
2021-06-08 01:23:25 +05:30
::Packages::PackagesFinder.new(object, filters.merge(SORT_TO_PARAMS_MAP.fetch(sort))).execute
2020-07-28 23:09:34 +05:30
end
end
end
2021-06-08 01:23:25 +05:30
# rubocop: enable Graphql/ResolverType