debian-mirror-gitlab/app/graphql/types/repository_type.rb

24 lines
1.2 KiB
Ruby
Raw Normal View History

2019-09-04 21:01:54 +05:30
# frozen_string_literal: true
module Types
class RepositoryType < BaseObject
graphql_name 'Repository'
authorize :download_code
2019-12-26 22:10:19 +05:30
field :root_ref, GraphQL::STRING_TYPE, null: true, calls_gitaly: true,
2021-03-11 19:13:27 +05:30
description: 'Default branch of the repository.'
2019-12-26 22:10:19 +05:30
field :empty, GraphQL::BOOLEAN_TYPE, null: false, method: :empty?, calls_gitaly: true,
2021-03-11 19:13:27 +05:30
description: 'Indicates repository has no visible content.'
2021-03-08 18:12:59 +05:30
field :exists, GraphQL::BOOLEAN_TYPE, null: false, method: :exists?, calls_gitaly: true,
2021-03-11 19:13:27 +05:30
description: 'Indicates a corresponding Git repository exists on disk.'
2019-12-26 22:10:19 +05:30
field :tree, Types::Tree::TreeType, null: true, resolver: Resolvers::TreeResolver, calls_gitaly: true,
2021-03-11 19:13:27 +05:30
description: 'Tree of the repository.'
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'
field :branch_names, [GraphQL::STRING_TYPE], null: true, calls_gitaly: true,
complexity: 170, description: 'Names of branches available in this repository that match the search pattern.',
resolver: Resolvers::RepositoryBranchNamesResolver
2019-09-04 21:01:54 +05:30
end
end