2019-09-04 21:01:54 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Types
|
|
|
|
class RepositoryType < BaseObject
|
|
|
|
graphql_name 'Repository'
|
|
|
|
|
|
|
|
authorize :download_code
|
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
field :blobs, Types::Repository::BlobType.connection_type, null: true, resolver: Resolvers::BlobsResolver, calls_gitaly: true,
|
|
|
|
description: 'Blobs contained within the repository'
|
2021-10-27 15:23:28 +05:30
|
|
|
field :branch_names, [GraphQL::Types::String], null: true, calls_gitaly: true,
|
2021-04-29 21:17:54 +05:30
|
|
|
complexity: 170, description: 'Names of branches available in this repository that match the search pattern.',
|
|
|
|
resolver: Resolvers::RepositoryBranchNamesResolver
|
2021-10-27 15:23:28 +05:30
|
|
|
field :disk_path, GraphQL::Types::String,
|
2021-06-08 01:23:25 +05:30
|
|
|
description: 'Shows a disk path of the repository.',
|
|
|
|
null: true,
|
|
|
|
authorize: :read_storage_disk_path
|
2022-05-07 20:08:51 +05:30
|
|
|
field :empty, GraphQL::Types::Boolean, null: false, method: :empty?, calls_gitaly: true,
|
|
|
|
description: 'Indicates repository has no visible content.'
|
|
|
|
field :exists, GraphQL::Types::Boolean, null: false, method: :exists?, calls_gitaly: true,
|
|
|
|
description: 'Indicates a corresponding Git repository exists on disk.'
|
|
|
|
field :paginated_tree, Types::Tree::TreeType.connection_type, null: true, resolver: Resolvers::PaginatedTreeResolver, calls_gitaly: true,
|
|
|
|
max_page_size: 100,
|
|
|
|
description: 'Paginated tree of the repository.'
|
|
|
|
field :root_ref, GraphQL::Types::String, null: true, calls_gitaly: true,
|
|
|
|
description: 'Default branch of the repository.'
|
|
|
|
field :tree, Types::Tree::TreeType, null: true, resolver: Resolvers::TreeResolver, calls_gitaly: true,
|
|
|
|
description: 'Tree of the repository.'
|
2019-09-04 21:01:54 +05:30
|
|
|
end
|
|
|
|
end
|