2021-01-29 00:20:46 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Mutations
|
|
|
|
module Terraform
|
|
|
|
module State
|
|
|
|
class Delete < Base
|
|
|
|
graphql_name 'TerraformStateDelete'
|
|
|
|
|
|
|
|
def resolve(id:)
|
|
|
|
state = authorized_find!(id: id)
|
2022-07-23 23:45:48 +05:30
|
|
|
response = ::Terraform::States::TriggerDestroyService.new(state, current_user: current_user).execute
|
2021-01-29 00:20:46 +05:30
|
|
|
|
2022-07-23 23:45:48 +05:30
|
|
|
{ errors: response.errors }
|
2021-01-29 00:20:46 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|