shopify_api-graphql-tiny 0.0.2 → 0.1.0
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/Changes +5 -0
- data/README.md +1 -1
- data/lib/shopify_api/graphql/tiny/version.rb +1 -1
- data/lib/shopify_api/graphql/tiny.rb +10 -10
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c46728d688b8edf620e1d9e5d9f78b32dcb4dde40854996e2a42b66f642596b
|
4
|
+
data.tar.gz: 5640ff9490907231cb4d2a9bae7d8f4f96460265bfcd6d77572d4f90e2b758d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e1f350a6269fbb377f29c2342add0ae82b103aa940047995e5f377896e7c0ca0ca555b3eb4f9083bfea8edf8e3f310ae2caf99e7de5ac1b1451b6b12d45158e
|
7
|
+
data.tar.gz: 9c5fad042bcb6cb2b638178bfe7a0dc5920ca585b1e317c310b25be9ec6c79476c2cf6342bde98ad0c3a467b4864edf37a7cdf9153f4b2ddbe58b49def372b4a
|
data/Changes
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Lightweight, no-nonsense, Shopify GraphQL Admin API client with built-in retry.
|
4
4
|
|
5
|
-

|
5
|
+
[](https://github.com/ScreenStaring/shopify_api-graphql-tiny/actions)
|
6
6
|
|
7
7
|
## Usage
|
8
8
|
|
@@ -24,6 +24,7 @@ module ShopifyAPI
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
+
RateLimitError = Class.new(GraphQLError)
|
27
28
|
|
28
29
|
class HTTPError < Error
|
29
30
|
attr_reader :code
|
@@ -34,14 +35,7 @@ module ShopifyAPI
|
|
34
35
|
end
|
35
36
|
end
|
36
37
|
|
37
|
-
|
38
|
-
attr_reader :response
|
39
|
-
|
40
|
-
def initialize(message, response)
|
41
|
-
super(message)
|
42
|
-
@response = response
|
43
|
-
end
|
44
|
-
end
|
38
|
+
USER_AGENT = "ShopifyAPI::GraphQL::Tiny v#{VERSION} (Ruby v#{RUBY_VERSION})"
|
45
39
|
|
46
40
|
SHOPIFY_DOMAIN = ".myshopify.com"
|
47
41
|
|
@@ -71,7 +65,7 @@ module ShopifyAPI
|
|
71
65
|
#
|
72
66
|
# [:retry (Boolean|Hash)] +Hash+ can be retry config options. For the format see {ShopifyAPIRetry}[https://github.com/ScreenStaring/shopify_api_retry/#usage]. Defaults to +true+
|
73
67
|
# [:version (String)] Shopify API version to use. Defaults to the latest version.
|
74
|
-
# [:debug (Boolean)] Output the HTTP request/response to +STDERR+. Defaults to +false+.
|
68
|
+
# [:debug (Boolean|IO)] Output the HTTP request/response to +STDERR+ or to its value if it's an +IO+. Defaults to +false+.
|
75
69
|
#
|
76
70
|
# === Errors
|
77
71
|
#
|
@@ -138,12 +132,18 @@ module ShopifyAPI
|
|
138
132
|
|
139
133
|
post = Net::HTTP::Post.new(@endpoint.path)
|
140
134
|
post.body = params.to_json
|
135
|
+
post["User-Agent"] = USER_AGENT
|
141
136
|
|
142
137
|
@headers.each { |k,v| post[k] = v }
|
143
138
|
|
144
139
|
request = Net::HTTP.new(@endpoint.host, @endpoint.port)
|
145
140
|
request.use_ssl = true
|
146
|
-
|
141
|
+
|
142
|
+
if @options[:debug]
|
143
|
+
request.set_debug_output(
|
144
|
+
@options[:debug].is_a?(IO) ? @options[:debug] : $stderr
|
145
|
+
)
|
146
|
+
end
|
147
147
|
|
148
148
|
response = request.start { |http| http.request(post) }
|
149
149
|
rescue => e
|
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.1.0
|
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-06-
|
11
|
+
date: 2022-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: shopify_api_retry
|
@@ -120,7 +120,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
|
-
|
123
|
+
rubyforge_project:
|
124
|
+
rubygems_version: 2.7.6
|
124
125
|
signing_key:
|
125
126
|
specification_version: 4
|
126
127
|
summary: Lightweight, no-nonsense, Shopify Admin API GraphQL client with built-in
|