2020-05-24 23:13:21 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Resolvers
|
|
|
|
class ReleaseResolver < BaseResolver
|
|
|
|
type Types::ReleaseType, null: true
|
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
argument :tag_name, GraphQL::Types::String,
|
2020-05-24 23:13:21 +05:30
|
|
|
required: true,
|
2021-11-11 11:23:49 +05:30
|
|
|
description: 'Name of the tag associated to the release.'
|
2020-05-24 23:13:21 +05:30
|
|
|
|
|
|
|
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
|