2021-01-03 14:25:43 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Resolvers
|
|
|
|
module Terraform
|
|
|
|
class StatesResolver < BaseResolver
|
2021-03-11 19:13:27 +05:30
|
|
|
type Types::Terraform::StateType.connection_type, null: true
|
2021-01-03 14:25:43 +05:30
|
|
|
|
|
|
|
alias_method :project, :object
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
when_single do
|
|
|
|
argument :name, GraphQL::STRING_TYPE,
|
|
|
|
required: true,
|
|
|
|
description: 'Name of the Terraform state.'
|
2021-01-03 14:25:43 +05:30
|
|
|
end
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
def resolve(**args)
|
|
|
|
::Terraform::StatesFinder
|
|
|
|
.new(project, current_user, params: args)
|
|
|
|
.execute
|
2021-01-03 14:25:43 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|