summaryrefslogtreecommitdiff
path: root/app/graphql/types/grafana_integration_type.rb
blob: 7db733fc62a5af1f754c2b76685f12653fa0d57d (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
# frozen_string_literal: true

module Types
  class GrafanaIntegrationType < ::Types::BaseObject
    graphql_name 'GrafanaIntegration'

    authorize :admin_operations

    field :id, GraphQL::ID_TYPE, null: false,
      description: 'Internal ID of the Grafana integration'
    field :grafana_url, GraphQL::STRING_TYPE, null: false,
      description: 'URL for the Grafana host for the Grafana integration'
    field :enabled, GraphQL::BOOLEAN_TYPE, null: false,
      description: 'Indicates whether Grafana integration is enabled'
    field :created_at, Types::TimeType, null: false,
          description: 'Timestamp of the issue\'s creation'
    field :updated_at, Types::TimeType, null: false,
          description: 'Timestamp of the issue\'s last activity'

    field :token, GraphQL::STRING_TYPE, null: false,
          deprecated: { reason: 'Plain text token has been masked for security reasons', milestone: '12.7' },
          description: 'API token for the Grafana integration'

    def token
      object.masked_token
    end
  end
end