Sha256: 8f525d532367198604b494bc7bef8f0ad5df20d9f3cff74fe014ce01be6afb55

Contents?: true

Size: 1012 Bytes

Versions: 59

Compression:

Stored size: 1012 Bytes

Contents

module Mutations
  module AnsibleVariableOverrides
    class Update < ::Mutations::UpdateMutation
      graphql_name 'UpdateAnsibleVariableOverrideMutation'
      description 'Updates Ansible Variable Override'

      resource_class LookupValue

      argument :value, ::Types::RawJson, required: true
      argument :match, String, required: false
      argument :omit, Boolean, required: false
      argument :host_id, Int, required: true
      argument :ansible_variable_id, Int, required: true

      field :overriden_ansible_variable, ::Types::OverridenAnsibleVariable, :null => true

      def resolve(host_id:, ansible_variable_id:, **kwargs)
        result = super kwargs
        host = Host.find host_id
        vars = AnsibleVariable.where :id => ansible_variable_id
        resolver = ::ForemanAnsible::OverrideResolver.new(host, vars.pluck(:id))
        result.merge :overriden_ansible_variable => ::Presenters::OverridenAnsibleVariablePresenter.new(vars.first, resolver)
      end
    end
  end
end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
foreman_ansible-11.0.0 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-10.2.0 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-10.1.0 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-10.0.1 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-10.0.0 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-7.1.4 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-9.0.1 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-7.1.3 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-9.0.0 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-7.1.2 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-7.1.1 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-8.0.1 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-8.0.0 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-7.0.4 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-7.1.0 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-7.0.3 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-7.0.2 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-7.0.1 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-7.0.0 app/graphql/mutations/ansible_variable_overrides/update.rb