Class: Types::ContainerRepositoryType

Inherits:
BaseObject
  • Object
show all
Defined in:
app/graphql/types/container_repository_type.rb

Direct Known Subclasses

ContainerRepositoryDetailsType

Instance Method Summary collapse

Methods inherited from BaseObject

accepts, assignable?, authorization, authorize, authorized?, #current_user, #id

Methods included from Gitlab::Graphql::Present

#present, #unpresented

Instance Method Details

#can_deleteObject


26
27
28
# File 'app/graphql/types/container_repository_type.rb', line 26

def can_delete
  Ability.allowed?(current_user, :update_container_image, object)
end

#projectObject


30
31
32
# File 'app/graphql/types/container_repository_type.rb', line 30

def project
  Gitlab::Graphql::Loaders::BatchModelLoader.new(Project, object.project_id).find
end

#tags_countObject


34
35
36
37
38
# File 'app/graphql/types/container_repository_type.rb', line 34

def tags_count
  object.tags_count
rescue Faraday::Error
  raise ::Gitlab::Graphql::Errors::ResourceNotAvailable, 'We are having trouble connecting to the Container Registry. If this error persists, please review the troubleshooting documentation.'
end