graphlient 0.3.6 → 0.3.7
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 +4 -4
- data/CHANGELOG.md +4 -1
- data/Gemfile +4 -0
- data/README.md +1 -0
- data/UPGRADING.md +12 -0
- data/lib/graphlient/adapters/http/faraday_adapter.rb +2 -0
- data/lib/graphlient/errors.rb +1 -0
- data/lib/graphlient/errors/connection_failed_error.rb +6 -0
- data/lib/graphlient/version.rb +1 -1
- data/spec/graphlient/adapters/http/faraday_adapter_spec.rb +21 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab92f3273bda224b78e022567186f00e9865d746ecb9de61d6ae392e480bc67d
|
4
|
+
data.tar.gz: 4e56127d81400beb61d1b9f502b63b3a712aa976d723dba524cbb6e579a7711b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0480cf615f51cd10d7c74efe03b0a291870027373cd9b4d5d3ee55b778ec4494379177823e1864f7d5c77da7c71eaead5a9870127a0976c9ba5ff0e84bbe9877
|
7
|
+
data.tar.gz: 73202625813b08c871393e7656412a2439caf4454e8d021c00fcd24e06cca47328bee530571e013e0e69fba217cbc284fa187ae0661f3e495eeb65e14995f6b4
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
### 0.3.
|
1
|
+
### 0.3.8 (Next)
|
2
2
|
* Your contribution here.
|
3
3
|
|
4
|
+
### 0.3.7 (14/11/2019)
|
5
|
+
* [#68](https://github.com/ashkan18/graphlient/pull/68): Add `Graphlient::Errors::ConnectionFailedError` - [@neroleung](https://github.com/neroleung).
|
6
|
+
|
4
7
|
### 0.3.6 (07/23/2019)
|
5
8
|
|
6
9
|
* [#63](https://github.com/ashkan18/graphlient/pull/63): Remove unused method for attribute with typo - [@ashkan18](https://github.com/ashkan18).
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -126,6 +126,7 @@ Unlike graphql-client, Graphlient will always raise an exception unless the quer
|
|
126
126
|
* [Graphlient::Errors::ServerError](lib/graphlient/errors/server_error.rb): all transport errors raised by HTTP Adapters. You can access `inner_exception`, `status_code` and `response` on these errors to get more details on what went wrong
|
127
127
|
* [Graphlient::Errors::FaradayServerError](lib/graphlient/errors/faraday_server_error.rb): this inherits from `ServerError` ☝️, we recommend using `ServerError` to rescue these
|
128
128
|
* [Graphlient::Errors::HttpServerError](lib/graphlient/errors/http_server_error.rb): this inherits from `ServerError` ☝️, we recommend using `ServerError` to rescue these
|
129
|
+
* [Graphlient::Errors::ConnectionFailedError](lib/graphlient/errors/connection_failed_error.rb): this inherits from `ServerError` ☝️, we recommend using `ServerError` to rescue these
|
129
130
|
|
130
131
|
|
131
132
|
All errors inherit from `Graphlient::Errors::Error` if you need to handle them in bulk.
|
data/UPGRADING.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
Upgrading Graphlient
|
2
|
+
===========================
|
3
|
+
|
4
|
+
### Upgrading to >= 0.3.7
|
5
|
+
|
6
|
+
#### Changes in error handling of connection refused error
|
7
|
+
|
8
|
+
Prior to 0.3.7, Graphlient would return `NoMethodError: undefined method []' for nil:NilClass` error if connection is
|
9
|
+
refused/failed when connecting to a remote host. After 0.3.7, Graphlient will return a new
|
10
|
+
`Graphlient::Errors::ConnectionFailedError` instead.
|
11
|
+
|
12
|
+
See [#68](https://github.com/ashkan18/graphlient/pull/68) for more information.
|
data/lib/graphlient/errors.rb
CHANGED
data/lib/graphlient/version.rb
CHANGED
@@ -57,4 +57,25 @@ describe Graphlient::Adapters::HTTP::FaradayAdapter do
|
|
57
57
|
expect(client.schema).to be_a Graphlient::Schema
|
58
58
|
end
|
59
59
|
end
|
60
|
+
|
61
|
+
context 'Failed to open TCP connection error' do
|
62
|
+
let(:url) { 'http://example.com/graphql' }
|
63
|
+
let(:client) { Graphlient::Client.new(url) }
|
64
|
+
let(:error_message) do
|
65
|
+
'Failed to open TCP connection to localhost:3000 (Connection refused - connect(2) for "localhost" port 3000)'
|
66
|
+
end
|
67
|
+
|
68
|
+
before do
|
69
|
+
wrapped_error = Errno::ECONNREFUSED.new(error_message)
|
70
|
+
error = Faraday::ConnectionFailed.new(wrapped_error)
|
71
|
+
|
72
|
+
stub_request(:post, url).to_raise(error)
|
73
|
+
end
|
74
|
+
|
75
|
+
specify do
|
76
|
+
expected_error_message = "Connection refused - #{error_message}"
|
77
|
+
|
78
|
+
expect { client.schema }.to raise_error(Graphlient::Errors::ConnectionFailedError, expected_error_message)
|
79
|
+
end
|
80
|
+
end
|
60
81
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphlient
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ashkan Nasseri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -72,6 +72,7 @@ files:
|
|
72
72
|
- README.md
|
73
73
|
- RELEASING.md
|
74
74
|
- Rakefile
|
75
|
+
- UPGRADING.md
|
75
76
|
- graphlient.gemspec
|
76
77
|
- lib/graphlient.rb
|
77
78
|
- lib/graphlient/adapters.rb
|
@@ -82,6 +83,7 @@ files:
|
|
82
83
|
- lib/graphlient/client.rb
|
83
84
|
- lib/graphlient/errors.rb
|
84
85
|
- lib/graphlient/errors/client_error.rb
|
86
|
+
- lib/graphlient/errors/connection_failed_error.rb
|
85
87
|
- lib/graphlient/errors/error.rb
|
86
88
|
- lib/graphlient/errors/execution_error.rb
|
87
89
|
- lib/graphlient/errors/faraday_server_error.rb
|
@@ -135,8 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
137
|
- !ruby/object:Gem::Version
|
136
138
|
version: 1.3.6
|
137
139
|
requirements: []
|
138
|
-
|
139
|
-
rubygems_version: 2.7.8
|
140
|
+
rubygems_version: 3.0.6
|
140
141
|
signing_key:
|
141
142
|
specification_version: 4
|
142
143
|
summary: A friendlier Ruby client for consuming GraphQL-based APIs.
|