Class: Mutations::AnsibleVariableOverrides::Create

Inherits:
CreateMutation
  • Object
show all
Defined in:
app/graphql/mutations/ansible_variable_overrides/create.rb

Instance Method Summary collapse

Instance Method Details

#resolve(host_id:, **kwargs) ⇒ Object



17
18
19
20
21
22
23
# File 'app/graphql/mutations/ansible_variable_overrides/create.rb', line 17

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