summaryrefslogtreecommitdiff
path: root/app/graphql/types/repository_type.rb
blob: b024eca61fca520c4c685f6f96d6f50242bad2b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

module Types
  class RepositoryType < BaseObject
    graphql_name 'Repository'

    authorize :download_code

    field :root_ref, GraphQL::STRING_TYPE, null: true, calls_gitaly: true
    field :empty, GraphQL::BOOLEAN_TYPE, null: false, method: :empty?, calls_gitaly: true
    field :exists, GraphQL::BOOLEAN_TYPE, null: false, method: :exists?
    field :tree, Types::Tree::TreeType, null: true, resolver: Resolvers::TreeResolver, calls_gitaly: true
  end
end