shopify_graphql 2.5.0 → 2.5.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9396a193dad0b344cca715ca90a406bc2dc53d49b4e806c9f8ba3b3469f83262
4
- data.tar.gz: 77ebbd5224182e0b5c1410317dc20aff62e69485848012e7d45df3ea8a846cb9
3
+ metadata.gz: 835956a5fd0a03ab1bdee46e0eebfe922f5ae1fb752e370f24eae2ddeba94c89
4
+ data.tar.gz: a42109e905b9310e95553432b504e5f081c4db92b2b4d1aee4c7fc1cc15d25f6
5
5
  SHA512:
6
- metadata.gz: 0ad3c88dfd11e4fab39a69d84eb62e528b1f3bfe0c78efc4668c736bdec50055efbf091f2cc275ddf80c8f955b05aaf20d380a985c53937683d098559b9f197c
7
- data.tar.gz: 2c91862377bb92d01fe6b00460ca14716cc334d5df0d88a5eecbaeefbcce9fa0a61053a1daa259d9bb70f73b821ba134623e01ca9cabe5f3a93d8d92224d77cf
6
+ metadata.gz: fa74302c607542f2c28ac9103c5d19ac30be2a5625976b817da5c702c4281f62024a5c51f7b1604fbe5db21770978047a8e1315738a0cdd98c267b66440b71d7
7
+ data.tar.gz: c572fd99e4f231f9b4edb7caace28daacfa92edb91ca0da993863dd2dbed7574ed9e797e86ff88c3a223a406291ea3122c2c2ae83dd3c16639264cc93b9c7894
@@ -25,8 +25,28 @@ module ShopifyGraphql
25
25
  DISPLAY_NAME_TO_PLAN = PLAN_TO_DISPLAY_NAME.invert
26
26
 
27
27
  class Client
28
+ NETWORK_ERRORS = [
29
+ Errno::ECONNRESET,
30
+ Errno::ECONNABORTED,
31
+ Errno::ECONNREFUSED,
32
+ Errno::EPIPE,
33
+ Errno::ENETUNREACH,
34
+ Errno::EHOSTUNREACH,
35
+ Errno::ETIMEDOUT,
36
+ Net::ReadTimeout,
37
+ Net::OpenTimeout,
38
+ OpenSSL::SSL::SSLError,
39
+ EOFError
40
+ ].freeze
41
+
28
42
  def client
29
- @client ||= ShopifyAPI::Clients::Graphql::Admin.new(session: ShopifyAPI::Context.active_session)
43
+ session = ShopifyAPI::Context.active_session
44
+ if @client.nil? || @access_token != session&.access_token || @shop != session&.shop
45
+ @client = ShopifyAPI::Clients::Graphql::Admin.new(session: session)
46
+ @access_token = session.access_token&.dup
47
+ @shop = session.shop.dup
48
+ end
49
+ @client
30
50
  end
31
51
 
32
52
  def execute(query, headers: nil, **variables)
@@ -36,7 +56,7 @@ module ShopifyGraphql
36
56
  Response.new(handle_response(e.response, e))
37
57
  rescue JSON::ParserError => e
38
58
  raise ServerError.new(response: response), "Invalid JSON response: #{e.message}"
39
- rescue Errno::ECONNRESET, Errno::EPIPE, Errno::ECONNREFUSED, Errno::ENETUNREACH, Net::ReadTimeout, Net::OpenTimeout, OpenSSL::SSL::SSLError, EOFError => e
59
+ rescue *NETWORK_ERRORS => e
40
60
  raise ServerError.new(response: response), "Network error: #{e.message}"
41
61
  rescue => e
42
62
  if (defined?(Socket::ResolutionError) and e.is_a?(Socket::ResolutionError))
@@ -1,3 +1,3 @@
1
1
  module ShopifyGraphql
2
- VERSION = "2.5.0"
2
+ VERSION = "2.5.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: 2.5.0
4
+ version: 2.5.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: 2026-07-10 00:00:00.000000000 Z
11
+ date: 2026-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails