debian-mirror-gitlab/app/graphql/resolvers/terraform/states_resolver.rb

24 lines
536 B
Ruby
Raw Normal View History

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
2021-10-27 15:23:28 +05:30
argument :name, GraphQL::Types::String,
2021-03-11 19:13:27 +05:30
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