shopify_api-graphql-tiny 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changes +4 -0
- data/lib/shopify_api/graphql/tiny/version.rb +1 -1
- data/lib/shopify_api/graphql/tiny.rb +19 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b83386464ba310b5225b0eaa43f9f2de9c942de2c1a1bd877e65b7aef41c4469
|
4
|
+
data.tar.gz: d6d6bc0d2a4dc61a0c430b712eadcf52dbd5355c4ed91a3a4c2b44e40933305f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b15b5bd7a5ce57beb926673041c803f822194ec1c32190a8b80099d4eda987c870084d08ab70d73f956a18b60a12130fb3b3d77846aa56d94346e254864aff6
|
7
|
+
data.tar.gz: 12235d40cea2cc700c6b74376521c4eec56369f7700232f3773d7ec08d5dd3254cb0e71ad5c2a1087591dcad6547d316841b28fcce0698d68bc097d40765ca62
|
data/Changes
ADDED
@@ -13,7 +13,17 @@ module ShopifyAPI
|
|
13
13
|
class Tiny
|
14
14
|
Error = Class.new(StandardError)
|
15
15
|
ConnectionError = Class.new(Error)
|
16
|
-
|
16
|
+
|
17
|
+
class GraphQLError < Error
|
18
|
+
# Hash of failed GraphQL response
|
19
|
+
attr_reader :response
|
20
|
+
|
21
|
+
def initialize(message, response)
|
22
|
+
super(message)
|
23
|
+
@response = response
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
17
27
|
|
18
28
|
class HTTPError < Error
|
19
29
|
attr_reader :code
|
@@ -37,8 +47,14 @@ module ShopifyAPI
|
|
37
47
|
|
38
48
|
ACCESS_TOKEN_HEADER = "X-Shopify-Access-Token"
|
39
49
|
QUERY_COST_HEADER = "X-GraphQL-Cost-Include-Fields"
|
40
|
-
|
50
|
+
|
41
51
|
DEFAULT_HEADERS = { "Content-Type" => "application/json" }.freeze
|
52
|
+
DEFAULT_RETRY_OPTIONS = {
|
53
|
+
ConnectionError => { :wait => 3, :tries => 20 },
|
54
|
+
GraphQLError => { :wait => 3, :tries => 20 },
|
55
|
+
HTTPError => { :wait => 3, :tries => 20 }
|
56
|
+
}
|
57
|
+
|
42
58
|
ENDPOINT = "https://%s/admin/api%s/graphql.json" # Note that we omit the "/" after API for the case where there's no version.
|
43
59
|
|
44
60
|
##
|
@@ -147,7 +163,7 @@ module ShopifyAPI
|
|
147
163
|
return json
|
148
164
|
end
|
149
165
|
|
150
|
-
raise GraphQLError
|
166
|
+
raise GraphQLError.new(prefix + errors, json)
|
151
167
|
end
|
152
168
|
end
|
153
169
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopify_api-graphql-tiny
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Skye Shaw
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: shopify_api_retry
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- ".github/workflows/ci.yml"
|
92
92
|
- ".gitignore"
|
93
93
|
- ".rspec"
|
94
|
+
- Changes
|
94
95
|
- Gemfile
|
95
96
|
- LICENSE.txt
|
96
97
|
- README.md
|
@@ -119,8 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
120
|
- !ruby/object:Gem::Version
|
120
121
|
version: '0'
|
121
122
|
requirements: []
|
122
|
-
|
123
|
-
rubygems_version: 2.7.6
|
123
|
+
rubygems_version: 3.1.4
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: Lightweight, no-nonsense, Shopify Admin API GraphQL client with built-in
|