graphlient 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.rubocop_todo.yml +5 -0
- data/.travis.yml +12 -3
- data/CHANGELOG.md +10 -0
- data/Gemfile +2 -2
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/graphlient.gemspec +1 -1
- data/lib/graphlient/adapters/http/http_adapter.rb +1 -3
- data/lib/graphlient/query.rb +1 -1
- data/lib/graphlient/version.rb +1 -1
- data/spec/graphlient/client_query_spec.rb +1 -1
- data/spec/graphlient/query_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2e6a1b6dd31d8be1b55aa0efbba64dce194bdee6f55a10c6d010148ff56a2274
|
4
|
+
data.tar.gz: 5740a5829835cf1af03733cccf2ac5a9b2621b57849d1b001d7fc517aafe6740
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ad460a9adba6796cbba204ddc7b843d1acee5396c2b24f018a54c2de5d168535e54ed07fc4241c16f8dd1f23967a73e8d576b748b27e0f134305984503e9bf9
|
7
|
+
data.tar.gz: 880bf215ab25b9519bec4cd1c4d6ca2c66139cb8d6beddb615b43b184eab99dcde3c8b666d9c750bc4b6842f89e0a0e826a585a7a04c75717b96b61ba8a7ee6a
|
data/.rubocop_todo.yml
CHANGED
data/.travis.yml
CHANGED
@@ -3,11 +3,20 @@ language: ruby
|
|
3
3
|
cache: bundler
|
4
4
|
|
5
5
|
rvm:
|
6
|
-
- 2.
|
7
|
-
- 2.
|
6
|
+
- 2.2.9
|
7
|
+
- 2.3.6
|
8
|
+
- 2.4.3
|
9
|
+
- 2.5.0
|
10
|
+
- ruby-head
|
11
|
+
- jruby-9.1.16.0
|
12
|
+
- jruby-head
|
8
13
|
|
9
14
|
matrix:
|
10
15
|
include:
|
11
|
-
- rvm: 2.3.
|
16
|
+
- rvm: 2.3.6
|
12
17
|
script:
|
13
18
|
- bundle exec danger
|
19
|
+
allow_failures:
|
20
|
+
- rvm: ruby-head
|
21
|
+
- rvm: jruby-9.1.16.0
|
22
|
+
- rvm: jruby-head
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
### 0.3.1 (Next)
|
2
|
+
|
3
|
+
* Your contribution here.
|
4
|
+
|
5
|
+
### 0.3.0 (02/22/2018)
|
6
|
+
|
7
|
+
* [#38](https://github.com/ashkan18/graphlient/pull/38): Add support for Ruby 2.5 - [@yuki24](https://github.com/yuki24).
|
8
|
+
* [#39](https://github.com/ashkan18/graphlient/pull/39): Add support for Ruby 2.2 - [@yuki24](https://github.com/yuki24).
|
9
|
+
* [#40](https://github.com/ashkan18/graphlient/pull/40): Add experimental support for JRuby - [@yuki24](https://github.com/yuki24).
|
10
|
+
|
1
11
|
### 0.2.0 (11/09/2017)
|
2
12
|
|
3
13
|
* [#33](https://github.com/ashkan18/graphlient/pull/33): Added dsl for supporting parametrized queries/mutations - [@ashkan18](https://github.com/ashkan18).
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -161,7 +161,7 @@ Graphlient supports following Scalar types for parameterized queries by default:
|
|
161
161
|
|
162
162
|
You can use any of the above types with `!` to make it required or use them in `[]` for array parameters.
|
163
163
|
|
164
|
-
For any other
|
164
|
+
For any other custom types, graphlient will simply use `to_s` of the symbol provided for the type, so `query(ids: [:InvoiceType!])` will result in `query($ids: [InvoiceType!])`.
|
165
165
|
|
166
166
|
The following mutation accepts a custom type that requires `fee_in_cents`.
|
167
167
|
|
data/Rakefile
CHANGED
data/graphlient.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.homepage = 'http://github.com/ashkan18/graphlient'
|
15
15
|
s.licenses = ['MIT']
|
16
16
|
s.summary = 'A friendlier Ruby client for consuming GraphQL-based APIs.'
|
17
|
-
s.add_dependency 'graphql-client'
|
18
17
|
s.add_dependency 'faraday'
|
19
18
|
s.add_dependency 'faraday_middleware'
|
19
|
+
s.add_dependency 'graphql-client'
|
20
20
|
end
|
@@ -4,14 +4,12 @@ module Graphlient
|
|
4
4
|
module Adapters
|
5
5
|
module HTTP
|
6
6
|
class HTTPAdapter < Adapter
|
7
|
-
attr_reader :uri
|
8
|
-
|
9
7
|
def execute(document:, operation_name: nil, variables: {}, context: {})
|
10
8
|
request = Net::HTTP::Post.new(url)
|
11
9
|
|
12
10
|
request['Accept'] = 'application/json'
|
13
11
|
request['Content-Type'] = 'application/json'
|
14
|
-
headers
|
12
|
+
headers && headers.each { |name, value| request[name] = value }
|
15
13
|
|
16
14
|
body = {}
|
17
15
|
body['query'] = document.to_query_string
|
data/lib/graphlient/query.rb
CHANGED
data/lib/graphlient/version.rb
CHANGED
@@ -82,7 +82,7 @@ describe Graphlient::Query do
|
|
82
82
|
it 'returns proper mutation with arguments' do
|
83
83
|
mutation = Graphlient::Query.new do
|
84
84
|
mutation do
|
85
|
-
invoice(type: 'test', fee_in_cents: 20_000, total_cents: 50_000, line_items: %w
|
85
|
+
invoice(type: 'test', fee_in_cents: 20_000, total_cents: 50_000, line_items: %w[li1 li2]) do
|
86
86
|
id
|
87
87
|
end
|
88
88
|
end
|
@@ -94,7 +94,7 @@ describe Graphlient::Query do
|
|
94
94
|
it 'returns proper mutation for relay style mutation' do
|
95
95
|
mutation = Graphlient::Query.new do
|
96
96
|
mutation do
|
97
|
-
invoice(input: { type: 'test', fee_in_cents: 20_000, total_cents: 50_000, line_items: %w
|
97
|
+
invoice(input: { type: 'test', fee_in_cents: 20_000, total_cents: 50_000, line_items: %w[li1 li2] }) do
|
98
98
|
id
|
99
99
|
end
|
100
100
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphlient
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ashkan Nasseri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: faraday
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: faraday_middleware
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: graphql-client
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
version: 1.3.6
|
126
126
|
requirements: []
|
127
127
|
rubyforge_project:
|
128
|
-
rubygems_version: 2.
|
128
|
+
rubygems_version: 2.7.4
|
129
129
|
signing_key:
|
130
130
|
specification_version: 4
|
131
131
|
summary: A friendlier Ruby client for consuming GraphQL-based APIs.
|