2019-05-22 11:43:35 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Types
|
|
|
|
class RepositoryType < BaseObject
|
|
|
|
graphql_name 'Repository'
|
|
|
|
|
|
|
|
authorize :download_code
|
|
|
|
|
2019-06-26 10:42:25 +00:00
|
|
|
field :root_ref, GraphQL::STRING_TYPE, null: true, calls_gitaly: true
|
|
|
|
field :empty, GraphQL::BOOLEAN_TYPE, null: false, method: :empty?, calls_gitaly: true
|
2019-05-22 11:43:35 +00:00
|
|
|
field :exists, GraphQL::BOOLEAN_TYPE, null: false, method: :exists?
|
2019-06-26 10:42:25 +00:00
|
|
|
field :tree, Types::Tree::TreeType, null: true, resolver: Resolvers::TreeResolver, calls_gitaly: true
|
2019-05-22 11:43:35 +00:00
|
|
|
end
|
|
|
|
end
|