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

update.rb « timeline_event « incident_management « mutations « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b35feed308249d3fbaa1ae81c683ed23e8fa9333 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# frozen_string_literal: true

module Mutations
  module IncidentManagement
    module TimelineEvent
      class Update < Base
        graphql_name 'TimelineEventUpdate'

        argument :id, ::Types::GlobalIDType[::IncidentManagement::TimelineEvent],
                 required: true,
                 description: 'ID of the timeline event to update.'

        argument :note, GraphQL::Types::String,
                 required: false,
                 description: 'Text note of the timeline event.'

        argument :occurred_at, Types::TimeType,
                 required: false,
                 description: 'Timestamp when the event occurred.'

        argument :timeline_event_tag_names, [GraphQL::Types::String],
                 required: false,
                 description: copy_field_description(Types::IncidentManagement::TimelineEventType, :timeline_event_tags)

        def resolve(id:, **args)
          timeline_event = authorized_find!(id: id)

          response ::IncidentManagement::TimelineEvents::UpdateService.new(
            timeline_event,
            current_user,
            args
          ).execute
        end
      end
    end
  end
end