Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/types/diff_stats_type.rb')
-rw-r--r--app/graphql/types/diff_stats_type.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/graphql/types/diff_stats_type.rb b/app/graphql/types/diff_stats_type.rb
new file mode 100644
index 00000000000..6c79a4c389d
--- /dev/null
+++ b/app/graphql/types/diff_stats_type.rb
@@ -0,0 +1,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 :path, GraphQL::STRING_TYPE, null: false,
+ description: 'File path, relative to repository root'
+ field :additions, GraphQL::INT_TYPE, null: false,
+ description: 'Number of lines added to this file'
+ field :deletions, GraphQL::INT_TYPE, null: false,
+ description: 'Number of lines deleted from this file'
+ end
+ # rubocop: enable Graphql/AuthorizeTypes
+end