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

25 lines
850 B
Ruby
Raw Normal View History

2021-01-29 00:20:46 +05:30
# frozen_string_literal: true
module Resolvers
class ContainerRepositoriesResolver < BaseResolver
include ::Mutations::PackageEventable
type Types::ContainerRepositoryType, null: true
2021-10-27 15:23:28 +05:30
argument :name, GraphQL::Types::String,
2021-01-29 00:20:46 +05:30
required: false,
2021-03-08 18:12:59 +05:30
description: 'Filter the container repositories by their name.'
2021-01-29 00:20:46 +05:30
2021-03-11 19:13:27 +05:30
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 })
2021-01-29 00:20:46 +05:30
.execute
.tap { track_event(:list_repositories, :container) }
end
end
end