debian-mirror-gitlab/app/graphql/resolvers/design_management/version_resolver.rb

26 lines
602 B
Ruby
Raw Normal View History

2020-05-24 23:13:21 +05:30
# frozen_string_literal: true
module Resolvers
module DesignManagement
class VersionResolver < BaseResolver
include Gitlab::Graphql::Authorize::AuthorizeResource
type Types::DesignManagement::VersionType, null: true
authorize :read_design
argument :id, GraphQL::ID_TYPE,
required: true,
description: 'The Global ID of the version'
def resolve(id:)
authorized_find!(id: id)
end
def find_object(id:)
GitlabSchema.object_from_id(id, expected_type: ::DesignManagement::Version)
end
end
end
end