debian-mirror-gitlab/app/graphql/types/environment_type.rb

34 lines
1.1 KiB
Ruby
Raw Normal View History

2020-03-13 15:44:24 +05:30
# frozen_string_literal: true
module Types
class EnvironmentType < BaseObject
graphql_name 'Environment'
description 'Describes where code is deployed for a project'
2021-01-03 14:25:43 +05:30
present_using ::EnvironmentPresenter
2020-03-13 15:44:24 +05:30
authorize :read_environment
field :name, GraphQL::STRING_TYPE, null: false,
2021-03-11 19:13:27 +05:30
description: 'Human-readable name of the environment.'
2020-03-13 15:44:24 +05:30
field :id, GraphQL::ID_TYPE, null: false,
2021-03-11 19:13:27 +05:30
description: 'ID of the environment.'
2020-04-22 19:07:51 +05:30
field :state, GraphQL::STRING_TYPE, null: false,
2021-03-11 19:13:27 +05:30
description: 'State of the environment, for example: available/stopped.'
2020-04-22 19:07:51 +05:30
2021-01-29 00:20:46 +05:30
field :path, GraphQL::STRING_TYPE, null: false,
description: 'The path to the environment.'
2021-01-03 14:25:43 +05:30
2020-04-22 19:07:51 +05:30
field :metrics_dashboard, Types::Metrics::DashboardType, null: true,
2021-03-11 19:13:27 +05:30
description: 'Metrics dashboard schema for the environment.',
2020-04-22 19:07:51 +05:30
resolver: Resolvers::Metrics::DashboardResolver
2020-10-24 23:57:45 +05:30
field :latest_opened_most_severe_alert,
Types::AlertManagement::AlertType,
null: true,
2021-03-11 19:13:27 +05:30
description: 'The most severe open alert for the environment. If multiple alerts have equal severity, the most recent is returned.'
2020-03-13 15:44:24 +05:30
end
end