Class: Resolvers::DesignManagement::VersionInCollectionResolver

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

Constant Summary collapse

VersionID =
::Types::GlobalIDType[::DesignManagement::Version]

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


35
36
37
# File 'app/graphql/resolvers/design_management/version_in_collection_resolver.rb', line 35

def self.single
  self
end

Instance Method Details

#resolve(version_id: nil, sha: nil) ⇒ Object


26
27
28
29
30
31
32
33
# File 'app/graphql/resolvers/design_management/version_in_collection_resolver.rb', line 26

def resolve(version_id: nil, sha: nil)
  check_args(version_id, sha)

  ::DesignManagement::VersionsFinder
    .new(collection, current_user, sha: sha, version_id: version_id&.model_id)
    .execute
    .first
end