tree_type.rb 793 字节
Newer Older
1 2 3
# frozen_string_literal: true
module Types
  module Tree
4 5
    # rubocop: disable Graphql/AuthorizeTypes
    # This is presented through `Repository` that has its own authorization
6 7 8
    class TreeType < BaseObject
      graphql_name 'Tree'

9 10 11 12
      field :trees, Types::Tree::TreeEntryType.connection_type, null: false, resolve: -> (obj, args, ctx) do
        Gitlab::Graphql::Representation::TreeEntry.decorate(obj.trees, obj.repository)
      end

13
      field :submodules, Types::Tree::SubmoduleType.connection_type, null: false
14 15 16 17

      field :blobs, Types::Tree::BlobType.connection_type, null: false, resolve: -> (obj, args, ctx) do
        Gitlab::Graphql::Representation::TreeEntry.decorate(obj.blobs, obj.repository)
      end
18
      # rubocop: enable Graphql/AuthorizeTypes
19 20 21
    end
  end
end