graphlient 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: cd0db2077a31028524926bedc3c7ac54c5f3e6eb
4
- data.tar.gz: d78c92a97b670680fc056c0996c975ee7a9df80c
2
+ SHA256:
3
+ metadata.gz: 2e6a1b6dd31d8be1b55aa0efbba64dce194bdee6f55a10c6d010148ff56a2274
4
+ data.tar.gz: 5740a5829835cf1af03733cccf2ac5a9b2621b57849d1b001d7fc517aafe6740
5
5
  SHA512:
6
- metadata.gz: c00966fb20008a0b9524c46b24a249d4551aef3d8543855e923ce6f2c40b71fefa8cb68874fbc660e90d7c8fd196b8c1dc3376a2e641968f83de271629ce016d
7
- data.tar.gz: 183d86c88b7344be098af445c96504dc866271cd1210b7d4e1b57da446dff1c919be8cebe79592c936792952d42257a1c23a9506442bdf1302e8e63b120c1501
6
+ metadata.gz: 5ad460a9adba6796cbba204ddc7b843d1acee5396c2b24f018a54c2de5d168535e54ed07fc4241c16f8dd1f23967a73e8d576b748b27e0f134305984503e9bf9
7
+ data.tar.gz: 880bf215ab25b9519bec4cd1c4d6ca2c66139cb8d6beddb615b43b184eab99dcde3c8b666d9c750bc4b6842f89e0a0e826a585a7a04c75717b96b61ba8a7ee6a
@@ -48,3 +48,8 @@ Style/MultilineBlockChain:
48
48
  Exclude:
49
49
  - 'spec/graphlient/client_query_spec.rb'
50
50
  - 'spec/graphlient/client_schema_spec.rb'
51
+
52
+ Style/SafeNavigation:
53
+ Exclude:
54
+ - 'lib/graphlient/client.rb'
55
+ - 'lib/graphlient/adapters/http/http_adapter.rb'
@@ -3,11 +3,20 @@ language: ruby
3
3
  cache: bundler
4
4
 
5
5
  rvm:
6
- - 2.3.1
7
- - 2.4.1
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.1
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
@@ -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
@@ -5,9 +5,9 @@ gemspec
5
5
  gem 'rake'
6
6
 
7
7
  group :development do
8
- gem 'byebug'
8
+ gem 'byebug', platform: :ruby
9
9
  gem 'danger-changelog', '~> 0.2.1'
10
- gem 'rubocop', '~> 0.47.1', require: false
10
+ gem 'rubocop', '~> 0.48', require: false
11
11
  end
12
12
 
13
13
  group :test do
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 costume types, graphlient will simply use `to_s` of the symbol provided for the type, so `query(ids: [:InvoiceType!])` will result in `query($ids: [InvoiceType!])`.
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
@@ -12,4 +12,4 @@ end
12
12
  require 'rubocop/rake_task'
13
13
  RuboCop::RakeTask.new(:rubocop)
14
14
 
15
- task default: %i(rubocop spec)
15
+ task default: %i[rubocop spec]
@@ -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&.each { |name, value| request[name] = value }
12
+ headers && headers.each { |name, value| request[name] = value }
15
13
 
16
14
  body = {}
17
15
  body['query'] = document.to_query_string
@@ -7,7 +7,7 @@ module Graphlient
7
7
  boolean: 'Boolean'
8
8
  }.freeze
9
9
 
10
- ROOT_NODES = %w(query mutation subscription).freeze
10
+ ROOT_NODES = %w[query mutation subscription].freeze
11
11
 
12
12
  attr_accessor :query_str
13
13
 
@@ -1,3 +1,3 @@
1
1
  module Graphlient
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.3.0'.freeze
3
3
  end
@@ -128,7 +128,7 @@ describe Graphlient::Client do
128
128
  end
129
129
 
130
130
  it 'returns a response from a GRAPHQL query' do
131
- response = client.query <<~GRAPHQL
131
+ response = client.query <<-GRAPHQL
132
132
  query {
133
133
  invoices(ids: [10]) {
134
134
  id
@@ -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(li1 li2)) do
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(li1 li2) }) do
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
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
3
  require 'rubygems'
4
4
  require 'rspec'
5
5
  require 'graphlient'
6
- require 'byebug'
6
+ require 'byebug' if RUBY_ENGINE != 'jruby'
7
7
  require 'rack/test'
8
8
  require 'webmock/rspec'
9
9
 
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.2.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: 2017-11-09 00:00:00.000000000 Z
11
+ date: 2018-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: graphql-client
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: faraday
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: faraday_middleware
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.5.1
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.