shopify_graphql 0.3.0 → 0.4.1
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/app/graphql/shopify_graphql/get_app_subscription.rb +4 -0
- data/lib/shopify_graphql/client.rb +12 -0
- 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: 21b4a873e0cc66c1e23474a6a8ca3ea2494aa8e42e202efef805119191d11d3f
|
4
|
+
data.tar.gz: e182f04e2d786bac83085e8f5117bf84af4f2e9373ee185d1263632b15ec6345
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b167b5b9ac039c1c353228d3ee5d8abd412baebe908d8828fb93ff1c2d023bbd6690075e10a1dc01fdbaaa966b88f07ed164ca6686983a27557a63ef61fb3702
|
7
|
+
data.tar.gz: be973dee48594d75a347ab63b0569e75395bcd6c20e4fb7871730cc4c01037498b0831fc500356648d8b3e03cf55e85a60e7287df9ac5a634efe57a013a48fa0
|
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.1
|
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
|
@@ -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.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.
|