2020-05-13 11:08:23 -04:00
|
|
|
# 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
|
|
|
|
|
2020-11-03 19:09:12 -05:00
|
|
|
argument :id, ::Types::GlobalIDType[::DesignManagement::Version],
|
2020-05-13 11:08:23 -04:00
|
|
|
required: true,
|
2021-08-17 20:11:18 -04:00
|
|
|
description: 'Global ID of the version.'
|
2020-05-13 11:08:23 -04:00
|
|
|
|
|
|
|
def resolve(id:)
|
|
|
|
authorized_find!(id: id)
|
|
|
|
end
|
|
|
|
|
|
|
|
def find_object(id:)
|
2020-11-03 19:09:12 -05:00
|
|
|
GitlabSchema.find_by_gid(id)
|
2020-05-13 11:08:23 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|