Class: GraphQL::Client::Aws

Inherits:
HTTP
  • Object
show all
Defined in:
lib/graphql/client/aws.rb

Instance Method Summary collapse

Constructor Details

#initialize(uri, **opts, &block) ⇒ Aws

Returns a new instance of Aws.



9
10
11
12
13
14
15
16
17
# File 'lib/graphql/client/aws.rb', line 9

def initialize(uri, **opts, &block)
  appsync_opts = opts.merge(service: 'appsync')
  @signer = ::Aws::Sigv4::Signer.new(appsync_opts)
  if block_given?
    super(uri, &block)
  else
    super(uri)
  end
end

Instance Method Details

#connectionObject



19
20
21
22
23
24
25
# File 'lib/graphql/client/aws.rb', line 19

def connection
  SignedHTTP.new(uri.host, uri.port).tap do |client|
    client.signer = @signer
    client.uri = uri
    client.use_ssl = uri.scheme == "https"
  end
end