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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6213e77b899e112f4e032f5dc5ac35dd488822180c1ec88602aa2628fa7cbaeb
4
- data.tar.gz: b1cc79d4ed621d2ebe4d116329bb56d395c770e9d41555db3c15bccec16e2cdc
3
+ metadata.gz: e5c044ffb73a80d80b528b5fa0db311615bce5b39b26fb6c84bbd2fba9a76678
4
+ data.tar.gz: 8fc1cb0cf055ed4e847dd51fce8d4d52d29db89308e48e930817c8a881c6132c
5
5
  SHA512:
6
- metadata.gz: 9f35db71a863859b55142cbb5cf11508e0848668eb06af7f54adba93f476190dd63b22af72822c1b4604b642b221b40e317e779fa7499ac48842daad916d292f
7
- data.tar.gz: 560cb1f70fd4f201fa9767db74ff2e79c2becb864f7cc5297ef0ecda866ba29d5a202c8bf9ea6df4f9c8a0970b854cb84001d13e795360a5445766d015bf699b
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
- > **This library is under active development. Breaking changes are likely until stable release.**
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
 
@@ -2,8 +2,8 @@ module ShopifyGraphql::Mutation
2
2
  extend ActiveSupport::Concern
3
3
 
4
4
  class_methods do
5
- def call(**kwargs)
6
- new.call(**kwargs)
5
+ def call(**kwargs, &block)
6
+ new.call(**kwargs, &block)
7
7
  end
8
8
  end
9
9
 
@@ -2,8 +2,8 @@ module ShopifyGraphql::Query
2
2
  extend ActiveSupport::Concern
3
3
 
4
4
  class_methods do
5
- def call(**kwargs)
6
- new.call(**kwargs)
5
+ def call(**kwargs, &block)
6
+ new.call(**kwargs, &block)
7
7
  end
8
8
  end
9
9
 
@@ -1,3 +1,3 @@
1
1
  module ShopifyGraphql
2
- VERSION = "0.3.1"
2
+ VERSION = "0.4.2"
3
3
  end
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.3.1
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-02-11 00:00:00.000000000 Z
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.2.22
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.