Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/types/packages/package_type.rb')
-rw-r--r--app/graphql/types/packages/package_type.rb19
1 files changed, 3 insertions, 16 deletions
diff --git a/app/graphql/types/packages/package_type.rb b/app/graphql/types/packages/package_type.rb
index b13d16e91c6..331898a1e84 100644
--- a/app/graphql/types/packages/package_type.rb
+++ b/app/graphql/types/packages/package_type.rb
@@ -2,26 +2,13 @@
module Types
module Packages
- class PackageType < BaseObject
+ class PackageType < PackageWithoutVersionsType
graphql_name 'Package'
description 'Represents a package in the Package Registry'
-
authorize :read_package
- field :id, GraphQL::ID_TYPE, null: false, description: 'The ID of the package.'
- field :name, GraphQL::STRING_TYPE, null: false, description: 'The name of the package.'
- field :created_at, Types::TimeType, null: false, description: 'The created date.'
- field :updated_at, Types::TimeType, null: false, description: 'The updated date.'
- field :version, GraphQL::STRING_TYPE, null: true, description: 'The version of the package.'
- field :package_type, Types::Packages::PackageTypeEnum, null: false, description: 'The type of the package.'
- field :tags, Types::Packages::PackageTagType.connection_type, null: true, description: 'The package tags.'
- field :project, Types::ProjectType, null: false, description: 'Project where the package is stored.'
- field :pipelines, Types::Ci::PipelineType.connection_type, null: true, description: 'Pipelines that built the package.'
- field :versions, Types::Packages::PackageType.connection_type, null: true, description: 'The other versions of the package.'
-
- def project
- Gitlab::Graphql::Loaders::BatchModelLoader.new(Project, object.project_id).find
- end
+ field :versions, ::Types::Packages::PackageWithoutVersionsType.connection_type, null: true,
+ description: 'The other versions of the package.'
end
end
end