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