Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sonodar/graphql-client-aws-ruby
GraphQL client library for AWS AppSync IAM Authorization
https://github.com/sonodar/graphql-client-aws-ruby
Last synced: 3 months ago
JSON representation
GraphQL client library for AWS AppSync IAM Authorization
- Host: GitHub
- URL: https://github.com/sonodar/graphql-client-aws-ruby
- Owner: sonodar
- License: mit
- Created: 2019-07-03T01:34:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-07T05:15:08.000Z (about 4 years ago)
- Last Synced: 2024-04-24T19:22:29.507Z (9 months ago)
- Language: Ruby
- Homepage:
- Size: 24.4 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/sonodar/graphql-client-aws-ruby.svg?branch=master)](https://travis-ci.org/sonodar/graphql-client-aws-ruby)
[![Coverage Status](https://coveralls.io/repos/github/sonodar/graphql-client-aws-ruby/badge.svg)](https://coveralls.io/github/sonodar/graphql-client-aws-ruby)
[![Gem Version](https://badge.fury.io/rb/graphql-client-aws.svg)](https://badge.fury.io/rb/graphql-client-aws)# graphql-client-aws
`graphql-client`([github/graphql-client](https://github.com/github/graphql-client)) を AWS AppSync の IAM 認証に対応させるための gem です。
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'graphql-client-aws'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install graphql-client-aws
## Usage
### Configuration
[オリジナルのサンプル](https://github.com/github/graphql-client#configuration)を以下のように書き換えて使用します。
`new` の URL 以外の引数は [Aws::Sigv4::Signer](https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/Sigv4/Signer.html) の `new` に渡されます。```diff
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](https://opensource.org/licenses/MIT).