Class: Resolvers::DesignManagement::Version::DesignAtVersionResolver

Inherits:
BaseResolver
  • Object
show all
Includes:
Gitlab::Graphql::Authorize::AuthorizeResource
Defined in:
app/graphql/resolvers/design_management/version/design_at_version_resolver.rb

Overview

Resolver for a DesignAtVersion object given an implicit version context

Constant Summary collapse

DesignAtVersionID =
::Types::GlobalIDType[::DesignManagement::DesignAtVersion]
DesignID =
::Types::GlobalIDType[::DesignManagement::Design]

Constants included from Gitlab::Graphql::Authorize::AuthorizeResource

Gitlab::Graphql::Authorize::AuthorizeResource::ConfigurationError, Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Gitlab::Graphql::Authorize::AuthorizeResource

#authorize!, #authorized_find!, #authorized_resource?, #find_object, #raise_resource_not_available_error!

Methods inherited from BaseResolver

as_single, authorization, authorized?, before_connection_authorization, before_connection_authorization_block, calls_gitaly!, complexity, complexity_multiplier, #current_user, field_options, last, #object, #offset_pagination, requires_argument!, resolver_complexity, #select_result, #single?, single_definition_blocks, singular_type, when_single

Methods included from Gitlab::Utils::Override

#extended, extensions, #included, #method_added, #override, #prepended, #queue_verification, verify!

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Class Method Details

.singleObject


30
31
32
# File 'app/graphql/resolvers/design_management/version/design_at_version_resolver.rb', line 30

def self.single
  self
end

Instance Method Details

#resolve(design_id: nil, filename: nil, design_at_version_id: nil) ⇒ Object


34
35
36
37
38
39
40
41
# File 'app/graphql/resolvers/design_management/version/design_at_version_resolver.rb', line 34

def resolve(design_id: nil, filename: nil, design_at_version_id: nil)
  validate_arguments(design_id, filename, design_at_version_id)

  return unless Ability.allowed?(current_user, :read_design, issue)
  return specific_design_at_version(design_at_version_id) if design_at_version_id

  find(design_id, filename).map { |d| make(d) }.first
end