12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/istox/helpers/graphql_client.rb', line 12
def query(host_type, query, variables = {})
client = @@hosts[host_type]
raise "Please make sure you have initialised graphql cient for host #{host_type}" unless client
log.info "Querying Graphql host: #{host_type}, query: #{query}, variables: #{variables.inspect}"
result = client.query(query, variables)
return_values = ::Istox::CommonHelper.to_open_struct(result&.data)
log.info "Graphql result: #{return_values.inspect}"
return_values
end
|