Sha256: 0b254632bbf9df0fe3ff16b2e80f59beb8d02ba6e668a6020841e943d7c05eba
Contents?: true
Size: 563 Bytes
Versions: 9
Compression:
Stored size: 563 Bytes
Contents
# frozen_string_literal: true require "net/http" require "uri" require "json" module GraphQL module Stitching class RemoteClient def initialize(url:, headers:{}) @url = url @headers = { "Content-Type" => "application/json" }.merge!(headers) end def call(_location, document, variables, _context) response = Net::HTTP.post( URI(@url), JSON.generate({ "query" => document, "variables" => variables }), @headers, ) JSON.parse(response.body) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems