shopify_oracle 0.2.0 → 0.5.0

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: b854be54bd921640d2e467ea55719ff4d20d5129e4555fdab04a165375d4a409
4
- data.tar.gz: 105ac42c35ec7ad9cc9ea0584f798db231e6023d3015bad526bf9ee007c95e46
3
+ metadata.gz: 6358f75aacaa0791a36916ced984495ed7915a4f478f4d3e79c7430055fa32ac
4
+ data.tar.gz: 550532875258cc60683bb84b93111553127ce88e8c18444695327443b6da1433
5
5
  SHA512:
6
- metadata.gz: 40c19dafa2dcf2fe3c670e6daf8c7546201019b39d1b7ccfa78ce92594f207b7249bffbea22be15dc87cae9b177354b790c8d42dc72a59a45009d30c326ea225
7
- data.tar.gz: a2b31cdcbce6c79aa77c001499c13b134bacff360b0f389eaba32b4593155bca425b3816dcc00e1046fa04bb54a071ce1ce34aa1d04632f666217e71d4c05511
6
+ metadata.gz: b965f4a3eb4cb32a06ef80c1177fdd0807442bda03ca918cbd769590a515025ba2c59073b8717c86b7364e3b17b69e25acd1ba698ad2e08b369fdf1ae934ef21
7
+ data.tar.gz: 68095adf5aa7f6deb0cb078b1f78ee0e41d91e48dda3611454612ca39029c6ff90287d36316d1362506f3801d434987f24a2347de09c9be9a78a1b6c50ae4364
@@ -3,9 +3,9 @@
3
3
  module ShopifyOracle
4
4
  module Connector
5
5
  class Mutater < Base
6
- def mutate(method, **args)
6
+ def mutate(method, variables:)
7
7
  mutation = ShopifyOracle::Mutations.const_get("#{method.to_s.upcase}_MUTATION".to_sym)
8
- @client.query(query: mutation, variables: args)
8
+ @client.query(query: mutation, variables:)
9
9
  end
10
10
  end
11
11
  end
@@ -3,9 +3,9 @@
3
3
  module ShopifyOracle
4
4
  module Connector
5
5
  class Querier < Base
6
- def query(method, **args)
6
+ def query(method, variables:)
7
7
  query = ShopifyOracle::Queries.const_get("#{method.to_s.upcase}_QUERY".to_sym)
8
- @client.query(query:, variables: args)
8
+ @client.query(query:, variables:)
9
9
  end
10
10
  end
11
11
  end
@@ -73,6 +73,13 @@ module ShopifyOracle
73
73
  options
74
74
  position
75
75
  productCount
76
+ products(first: $first) {
77
+ edges {
78
+ node {
79
+ id
80
+ }
81
+ }
82
+ }
76
83
  productVariantCount
77
84
  productVariants(first: $first) {
78
85
  edges {
@@ -231,11 +238,53 @@ module ShopifyOracle
231
238
  }
232
239
  GRAPHQL
233
240
 
234
- SUBSCRIPTION_CONTRACT = <<~GRAPHQL.freeze
241
+ ADDRESS = <<~GRAPHQL
242
+ fragment Address on SubscriptionMailingAddress {
243
+ address1
244
+ address2
245
+ city
246
+ company
247
+ country
248
+ countryCode
249
+ firstName
250
+ lastName
251
+ name
252
+ phone
253
+ province
254
+ provinceCode
255
+ zip
256
+ }
257
+ GRAPHQL
258
+
259
+ SHIPPING_OPTION = <<~GRAPHQL
260
+ fragment ShippingOption on SubscriptionDeliveryMethodShippingOption {
261
+ code
262
+ description
263
+ presentmentTitle
264
+ title
265
+ }
266
+ GRAPHQL
267
+
268
+ DELIVERY_METHOD = <<~GRAPHQL
269
+ #{ADDRESS}
270
+ #{SHIPPING_OPTION}
271
+
272
+ fragment DeliveryMethod on SubscriptionDeliveryMethodShipping {
273
+ address {
274
+ ...Address
275
+ }
276
+ shippingOption {
277
+ ...ShippingOption
278
+ }
279
+ }
280
+ GRAPHQL
281
+
282
+ SUBSCRIPTION_CONTRACT = <<~GRAPHQL
235
283
  #{MONEY}
236
284
  #{BILLING_POLICY}
237
285
  #{DELIVERY_POLICY}
238
286
  #{CUSTOMER}
287
+ #{DELIVERY_METHOD}
239
288
 
240
289
  fragment SubscriptionContract on SubscriptionContract {
241
290
  id
@@ -266,7 +315,11 @@ module ShopifyOracle
266
315
  customer {
267
316
  ...Customer
268
317
  }
269
- deliveryMethod
318
+ deliveryMethod {
319
+ ... on SubscriptionDeliveryMethodShipping {
320
+ ...DeliveryMethod
321
+ }
322
+ }
270
323
  }
271
324
  GRAPHQL
272
325
  end
@@ -29,7 +29,7 @@ module ShopifyOracle
29
29
  shop ||= @shop
30
30
 
31
31
  @querier = ShopifyOracle::Connector::Querier.new(shop:)
32
- @mutater = ShopifyOracle::Connector::Mutater.new(shop:)
32
+ @mutator = ShopifyOracle::Connector::Mutater.new(shop:)
33
33
  @initialized = true
34
34
  end
35
35
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_oracle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yari Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-09 00:00:00.000000000 Z
11
+ date: 2022-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shopify_api