class Graphlient::Adapters::HTTP::HTTPAdapter
def execute(document:, operation_name: nil, variables: {}, context: {})
def execute(document:, operation_name: nil, variables: {}, context: {}) request = Net::HTTP::Post.new(url) request['Accept'] = 'application/json' request['Content-Type'] = 'application/json' headers && headers.each { |name, value| request[name] = value } body = {} body['query'] = document.to_query_string body['variables'] = variables if variables.any? body['operationName'] = operation_name if operation_name request.body = JSON.generate(body) response = connection.request(request) raise Graphlient::Errors::HttpServerError, response unless response.is_a?(Net::HTTPOK) JSON.parse(response.body) end