2020-10-22 11:08:25 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Resolvers
|
|
|
|
class ContainerRepositoriesResolver < BaseResolver
|
2020-11-12 19:09:49 -05:00
|
|
|
include ::Mutations::PackageEventable
|
|
|
|
|
2020-10-22 11:08:25 -04:00
|
|
|
type Types::ContainerRepositoryType, null: true
|
|
|
|
|
|
|
|
argument :name, GraphQL::STRING_TYPE,
|
|
|
|
required: false,
|
2021-01-11 19:10:42 -05:00
|
|
|
description: 'Filter the container repositories by their name.'
|
2020-10-22 11:08:25 -04:00
|
|
|
|
2021-02-09 13:09:59 -05:00
|
|
|
argument :sort, Types::ContainerRepositorySortEnum,
|
|
|
|
description: 'Sort container repositories by this criteria.',
|
|
|
|
required: false,
|
|
|
|
default_value: :created_desc
|
|
|
|
|
|
|
|
def resolve(name: nil, sort: nil)
|
|
|
|
ContainerRepositoriesFinder.new(user: current_user, subject: object, params: { name: name, sort: sort })
|
2020-10-22 11:08:25 -04:00
|
|
|
.execute
|
|
|
|
.tap { track_event(:list_repositories, :container) }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|