2020-05-06 20:11:11 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Resolvers
|
|
|
|
class ReleaseResolver < BaseResolver
|
|
|
|
type Types::ReleaseType, null: true
|
|
|
|
|
2021-07-22 08:10:04 -04:00
|
|
|
argument :tag_name, GraphQL::Types::String,
|
2020-05-06 20:11:11 -04:00
|
|
|
required: true,
|
2021-08-19 14:10:32 -04:00
|
|
|
description: 'Name of the tag associated to the release.'
|
2020-05-06 20:11:11 -04:00
|
|
|
|
|
|
|
alias_method :project, :object
|
|
|
|
|
|
|
|
def self.single
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def resolve(tag_name:)
|
|
|
|
ReleasesFinder.new(
|
|
|
|
project,
|
|
|
|
current_user,
|
|
|
|
{ tag: tag_name }
|
|
|
|
).execute.first
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|