11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/istox/helpers/graphql_client.rb', line 11
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
Rails.logger.debug "Querying Graphql host: #{host_type}, query: #{query}, variables: #{variables.inspect}"
result = client.query(query, variables)
return_values = ::Istox::CommonHelper.to_open_struct(result&.data)
Rails.logger.debug "Graphql result: #{return_values.inspect}"
return_values
end
|