shopify_graphql 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/shopify_graphql/client.rb +12 -0
- data/lib/shopify_graphql/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '018b4cef704098a6424fda98cb9805a11e86c29fd3e5a391e5945687a7ddc621'
|
4
|
+
data.tar.gz: 1f4e1be2f4b3edbf319251023a6a9d596bf34fa1f877dc51269d0cd9bb5db6f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2d0fdd479419a47c2647dffdc6cf65c1c09dfd6b66b35e2e13df9827b0844f0ee2191471d3a53ac42ddb60ecfec2f180457e61082fb209a385628e49c0a62af
|
7
|
+
data.tar.gz: cb05b2a483d83066fc233625938da8243905086baa31b0b29b1b6ff1af82f1b0afd5eb8534b4f3539b9f79fcc6c866a56295db1587a0a168fef33dbfe1242e3a
|
data/README.md
CHANGED
@@ -10,8 +10,8 @@ Less painful way to work with [Shopify Graphql API](https://shopify.dev/api/admi
|
|
10
10
|
- Graphql webhooks integration
|
11
11
|
- Built-in error handling
|
12
12
|
- No schema and no memory issues
|
13
|
+
- Buil-in retry on error
|
13
14
|
- (Planned) Testing helpers
|
14
|
-
- (Planned) Buil-in retry on error
|
15
15
|
- (Planned) Pre-built calls for common Graphql operations
|
16
16
|
|
17
17
|
## Usage
|
@@ -1,5 +1,16 @@
|
|
1
1
|
module ShopifyGraphql
|
2
2
|
class Client
|
3
|
+
RETRIABLE_EXCEPTIONS = [
|
4
|
+
Errno::ETIMEDOUT,
|
5
|
+
Errno::ECONNREFUSED,
|
6
|
+
Errno::EHOSTUNREACH,
|
7
|
+
'Timeout::Error',
|
8
|
+
Faraday::TimeoutError,
|
9
|
+
Faraday::RetriableResponse,
|
10
|
+
Faraday::ParsingError,
|
11
|
+
Faraday::ConnectionFailed,
|
12
|
+
].freeze
|
13
|
+
|
3
14
|
def initialize(api_version = ShopifyAPI::Base.api_version)
|
4
15
|
@api_version = api_version
|
5
16
|
end
|
@@ -29,6 +40,7 @@ module ShopifyGraphql
|
|
29
40
|
@connection ||= Faraday.new(url: api_url, headers: request_headers) do |conn|
|
30
41
|
conn.request :json
|
31
42
|
conn.response :json, parser_options: { object_class: OpenStruct }
|
43
|
+
conn.request :retry, max: 3, interval: 1, backoff_factor: 2, exceptions: RETRIABLE_EXCEPTIONS
|
32
44
|
end
|
33
45
|
end
|
34
46
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopify_graphql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kirill Platonov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '0'
|
137
137
|
requirements: []
|
138
|
-
rubygems_version: 3.2.
|
138
|
+
rubygems_version: 3.2.33
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
141
|
summary: Less painful way to work with Shopify Graphql API in Ruby.
|