2022-01-26 12:08:38 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Resolvers
|
|
|
|
module Ci
|
|
|
|
# NOTE: This class was introduced to allow modifying the meaning of certain values in RunnerStatusEnum
|
2022-07-16 23:28:13 +05:30
|
|
|
# while preserving backward compatibility. It can be removed in 17.0 after being deprecated
|
|
|
|
# and made a no-op in %16.0 (legacy_mode will be hard-coded to nil).
|
2022-01-26 12:08:38 +05:30
|
|
|
class RunnerStatusResolver < BaseResolver
|
|
|
|
type Types::Ci::RunnerStatusEnum, null: false
|
|
|
|
|
|
|
|
alias_method :runner, :object
|
|
|
|
|
|
|
|
argument :legacy_mode,
|
|
|
|
type: GraphQL::Types::String,
|
2023-07-09 08:55:56 +05:30
|
|
|
default_value: nil,
|
2022-01-26 12:08:38 +05:30
|
|
|
required: false,
|
2023-07-09 08:55:56 +05:30
|
|
|
description: 'No-op, left for compatibility.',
|
2022-07-16 23:28:13 +05:30
|
|
|
deprecated: {
|
2023-07-09 08:55:56 +05:30
|
|
|
reason: 'Will be removed in 17.0',
|
2022-07-16 23:28:13 +05:30
|
|
|
milestone: '15.0'
|
|
|
|
}
|
2022-01-26 12:08:38 +05:30
|
|
|
|
2023-07-09 08:55:56 +05:30
|
|
|
def resolve(**args)
|
|
|
|
runner.status
|
2022-01-26 12:08:38 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|