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/mutations/incident_management/timeline_event/base.rb')
-rw-r--r--app/graphql/mutations/incident_management/timeline_event/base.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/app/graphql/mutations/incident_management/timeline_event/base.rb b/app/graphql/mutations/incident_management/timeline_event/base.rb
new file mode 100644
index 00000000000..742470b4831
--- /dev/null
+++ b/app/graphql/mutations/incident_management/timeline_event/base.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+module Mutations
+ module IncidentManagement
+ module TimelineEvent
+ class Base < BaseMutation
+ field :timeline_event,
+ ::Types::IncidentManagement::TimelineEventType,
+ null: true,
+ description: 'Timeline event.'
+
+ authorize :admin_incident_management_timeline_event
+
+ private
+
+ def response(result)
+ {
+ timeline_event: result.payload[:timeline_event],
+ errors: result.errors
+ }
+ end
+
+ def find_object(id:)
+ GitlabSchema.object_from_id(id, expected_type: ::IncidentManagement::TimelineEvent).sync
+ end
+ end
+ end
+ end
+end