shopify_graphql 2.4.0 → 2.5.1
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 +4 -4
- data/lib/shopify_graphql/client.rb +9 -1
- data/lib/shopify_graphql/exceptions.rb +4 -0
- data/lib/shopify_graphql/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 827b03ca608d7ae514f1758fb96ebc253783b778cbe376d8e2a5d3ab772b42da
|
|
4
|
+
data.tar.gz: b473cac1e4ac0dcf34ea3895dcaa6cadf0bb5dd4d2ea434b1ed4350dcd137839
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 169c9249f8ac75c8f7c07d087b91cc6ff7a09ea9b8d361e4a2e746106f71fb6dca3f81dce546b6e3dfd0df1fe73bd8657d7adf515656232e38ec6053621fb9fd
|
|
7
|
+
data.tar.gz: b4633cdc0d303d4e9f4f7fee089c5ff7e67793a4c28ae3779a7f093cfed030405f3a77fd1760490ce6b022a2e179ad689fa7400db1294bf2c291f40999242dd4
|
|
@@ -26,7 +26,13 @@ module ShopifyGraphql
|
|
|
26
26
|
|
|
27
27
|
class Client
|
|
28
28
|
def client
|
|
29
|
-
|
|
29
|
+
session = ShopifyAPI::Context.active_session
|
|
30
|
+
if @client.nil? || @access_token != session&.access_token || @shop != session&.shop
|
|
31
|
+
@client = ShopifyAPI::Clients::Graphql::Admin.new(session: session)
|
|
32
|
+
@access_token = session.access_token&.dup
|
|
33
|
+
@shop = session.shop.dup
|
|
34
|
+
end
|
|
35
|
+
@client
|
|
30
36
|
end
|
|
31
37
|
|
|
32
38
|
def execute(query, headers: nil, **variables)
|
|
@@ -110,6 +116,8 @@ module ShopifyGraphql
|
|
|
110
116
|
TooManyRequests.new(response: response)
|
|
111
117
|
when "INTERNAL_SERVER_ERROR"
|
|
112
118
|
ServerError.new(response: response)
|
|
119
|
+
when "SHOP_PENDING_TERMINATION"
|
|
120
|
+
ShopPendingTermination.new(response: response)
|
|
113
121
|
else
|
|
114
122
|
ConnectionError.new(response: response)
|
|
115
123
|
end
|
|
@@ -65,6 +65,10 @@ module ShopifyGraphql
|
|
|
65
65
|
class ShopLocked < ClientError # :nodoc:
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
+
# GraphQL SHOP_PENDING_TERMINATION error code (shop is under review)
|
|
69
|
+
class ShopPendingTermination < ClientError # :nodoc:
|
|
70
|
+
end
|
|
71
|
+
|
|
68
72
|
# 429 Too Many Requests
|
|
69
73
|
class TooManyRequests < ClientError # :nodoc:
|
|
70
74
|
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.
|
|
4
|
+
version: 2.5.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:
|
|
11
|
+
date: 2026-09-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|