blob: 32047cda213790a4b920db40f2a3bd9cf95b753f (
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
|
# frozen_string_literal: true
module Mutations
module Metrics
module Dashboard
module Annotations
class Delete < Base
graphql_name 'DeleteAnnotation'
authorize :admin_metrics_dashboard_annotation
argument :id, ::Types::GlobalIDType[::Metrics::Dashboard::Annotation],
required: true,
description: 'Global ID of the annotation to delete.'
def resolve(id:)
raise_resource_not_available_error! if Feature.enabled?(:remove_monitor_metrics)
annotation = authorized_find!(id: id)
result = ::Metrics::Dashboard::Annotations::DeleteService.new(context[:current_user], annotation).execute
errors = Array.wrap(result[:message])
{
errors: errors
}
end
end
end
end
end
end
|