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

28 lines
603 B
Ruby
Raw Normal View History

2020-05-24 23:13:21 +05:30
# frozen_string_literal: true
module Resolvers
class ReleaseResolver < BaseResolver
type Types::ReleaseType, null: true
argument :tag_name, GraphQL::STRING_TYPE,
required: true,
description: 'The name of the tag associated to the release'
alias_method :project, :object
def self.single
self
end
def resolve(tag_name:)
2020-07-28 23:09:34 +05:30
return unless Feature.enabled?(:graphql_release_data, project, default_enabled: true)
2020-05-24 23:13:21 +05:30
ReleasesFinder.new(
project,
current_user,
{ tag: tag_name }
).execute.first
end
end
end