graphql-client-aws

graphql-client(github/graphql-client) を AWS AppSync に対応させるための gem です。

Installation

Add this line to your application's Gemfile:

gem 'graphql-client-aws'

And then execute:

$ bundle

Or install it yourself as:

$ gem install graphql-client-aws

Usage

Configuration

オリジナルのサンプルを以下のように書き換えて使用します。

require "graphql/client"
- require "graphql/client/http"
+ require "graphql/client/aws"

# Star Wars API example wrapper
module SWAPI
  # Configure GraphQL endpoint using the basic HTTP network adapter.
- HTTP = GraphQL::Client::HTTP.new("https://example.com/graphql") do 
+ HTTP = GraphQL::Client::Aws.new("https://example.com/graphql", region: 'us-east-1') do
    def headers(context)
      # Optionally set any HTTP headers
      { "User-Agent": "My Client" }
    end
  end

License

The gem is available as open source under the terms of the MIT License.