shopify_graphql 0.3.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/shopify_graphql/client.rb +12 -0
- data/lib/shopify_graphql/mutation.rb +2 -2
- data/lib/shopify_graphql/query.rb +2 -2
- data/lib/shopify_graphql/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5c044ffb73a80d80b528b5fa0db311615bce5b39b26fb6c84bbd2fba9a76678
|
4
|
+
data.tar.gz: 8fc1cb0cf055ed4e847dd51fce8d4d52d29db89308e48e930817c8a881c6132c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d8e8c1aff9b0517c5ebab5cbe938f87f0040fff6a26a31212b123fdafbe56717442d01d9104cff79fc003a90f762e69f2721f2f55fceb459d600f1a72dfbd22
|
7
|
+
data.tar.gz: c33b10f631685e8031479f90778bef818cd5681767d9043e96ffe050730af3089066f713b78895f95968edc3562eaa049a2dd9c9ef760fb9731327408a63fa29
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Less painful way to work with [Shopify Graphql API](https://shopify.dev/api/admin/graphql/reference) in Ruby.
|
4
4
|
|
5
|
-
> **
|
5
|
+
> **NOTE: The library only supports `shopify_api` < 10.0 at the moment.**
|
6
6
|
|
7
7
|
## Features
|
8
8
|
|
@@ -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.2
|
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-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: shopify_api
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
33
|
+
version: '10.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "<"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
40
|
+
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: shopify_app
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -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.
|
138
|
+
rubygems_version: 3.3.7
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
141
|
summary: Less painful way to work with Shopify Graphql API in Ruby.
|