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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-18 13:34:06 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-18 13:34:06 +0300
commit859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch)
treed7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /app/graphql/types/event_type.rb
parent446d496a6d000c73a304be52587cd9bbc7493136 (diff)
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'app/graphql/types/event_type.rb')
-rw-r--r--app/graphql/types/event_type.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/app/graphql/types/event_type.rb b/app/graphql/types/event_type.rb
new file mode 100644
index 00000000000..2a4c2e7c60a
--- /dev/null
+++ b/app/graphql/types/event_type.rb
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+
+module Types
+ class EventType < BaseObject
+ graphql_name 'Event'
+ description 'Representing an event'
+
+ present_using EventPresenter
+
+ authorize :read_event
+
+ field :id, GraphQL::ID_TYPE,
+ description: 'ID of the event.',
+ null: false
+
+ field :author, Types::UserType,
+ description: 'Author of this event.',
+ null: false
+
+ field :action, Types::EventActionEnum,
+ description: 'Action of the event.',
+ null: false
+
+ field :created_at, Types::TimeType,
+ description: 'When this event was created.',
+ null: false
+
+ field :updated_at, Types::TimeType,
+ description: 'When this event was updated.',
+ null: false
+
+ def author
+ Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.author_id).find
+ end
+ end
+end