diff options
Diffstat (limited to 'app/graphql/types/metrics/dashboards/annotation_type.rb')
-rw-r--r-- | app/graphql/types/metrics/dashboards/annotation_type.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/app/graphql/types/metrics/dashboards/annotation_type.rb b/app/graphql/types/metrics/dashboards/annotation_type.rb new file mode 100644 index 00000000000..055d2544eff --- /dev/null +++ b/app/graphql/types/metrics/dashboards/annotation_type.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module Types + module Metrics + module Dashboards + class AnnotationType < ::Types::BaseObject + authorize :read_metrics_dashboard_annotation + graphql_name 'MetricsDashboardAnnotation' + + field :description, GraphQL::STRING_TYPE, null: true, + description: 'Description of the annotation' + + field :id, GraphQL::ID_TYPE, null: false, + description: 'ID of the annotation' + + field :panel_id, GraphQL::STRING_TYPE, null: true, + description: 'ID of a dashboard panel to which the annotation should be scoped' + + field :starting_at, GraphQL::STRING_TYPE, null: true, + description: 'Timestamp marking start of annotated time span' + + field :ending_at, GraphQL::STRING_TYPE, null: true, + description: 'Timestamp marking end of annotated time span' + + def panel_id + object.panel_xid + end + end + end + end +end |