diff options
Diffstat (limited to 'app/graphql/types/alert_management/alert_type.rb')
-rw-r--r-- | app/graphql/types/alert_management/alert_type.rb | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/app/graphql/types/alert_management/alert_type.rb b/app/graphql/types/alert_management/alert_type.rb index 089d2426158..1a0b0685ffe 100644 --- a/app/graphql/types/alert_management/alert_type.rb +++ b/app/graphql/types/alert_management/alert_type.rb @@ -71,7 +71,7 @@ module Types description: 'Number of events of this alert', method: :events - field :details, + field :details, # rubocop:disable Graphql/JSONType GraphQL::Types::JSON, null: true, description: 'Alert details' @@ -94,8 +94,28 @@ module Types field :metrics_dashboard_url, GraphQL::STRING_TYPE, null: true, - description: 'URL for metrics embed for the alert', - resolve: -> (alert, _args, _context) { alert.present.metrics_dashboard_url } + description: 'URL for metrics embed for the alert' + + field :runbook, + GraphQL::STRING_TYPE, + null: true, + description: 'Runbook for the alert as defined in alert details' + + field :todos, + Types::TodoType.connection_type, + null: true, + description: 'Todos of the current user for the alert', + resolver: Resolvers::TodoResolver + + field :details_url, + GraphQL::STRING_TYPE, + null: false, + description: 'The URL of the alert detail page' + + field :prometheus_alert, + Types::PrometheusAlertType, + null: true, + description: 'The alert condition for Prometheus' def notes object.ordered_notes |