summaryrefslogtreecommitdiff
path: root/app/graphql/types/diff_stats_type.rb
blob: a6b7f8e90846ef192ac7461659c5fc05c6bcbfbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module Types
  # rubocop: disable Graphql/AuthorizeTypes
  # Types that use DiffStatsType should have their own authorization
  class DiffStatsType < BaseObject
    graphql_name 'DiffStats'

    description 'Changes to a single file'

    field :additions, GraphQL::Types::Int, null: false,
                                           description: 'Number of lines added to this file.'
    field :deletions, GraphQL::Types::Int, null: false,
                                           description: 'Number of lines deleted from this file.'
    field :path, GraphQL::Types::String, null: false,
                                         description: 'File path, relative to repository root.'
  end
  # rubocop: enable Graphql/AuthorizeTypes
end