shopify_graphql 1.1.1 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -63
- data/lib/shopify_graphql/jobs/update_webhooks_job.rb +2 -0
- data/lib/shopify_graphql/response.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: d369baa765d2026c9ccc02017bb2b6a490b202ad30b6a789eec1f0d2dfc313c6
|
4
|
+
data.tar.gz: c4054cbd4b4c5432e53c810374e1ec1acd4b64c0af6a4059858946aa0795056c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d2b5610659195319c502304bd1b0a7f741d46da3c4342b1afd0224a39a421463a39b2e0c7132c67aa90c20aa114a7baf9a0bda4611ccfdcdc30bf6a503b038d
|
7
|
+
data.tar.gz: f8f2ee0d61394d5fcd20ab25c75d87eb404b545685da95cdbd65f4cecc477b63ac8c226b0acaf2be57f9cc6c6be848ca725846ef40aefea15eb12425e958b67f
|
data/README.md
CHANGED
@@ -384,24 +384,7 @@ class GetProducts
|
|
384
384
|
QUERY = <<~GRAPHQL
|
385
385
|
#{ProductFields::FRAGMENT}
|
386
386
|
|
387
|
-
query {
|
388
|
-
products(first: #{LIMIT}) {
|
389
|
-
edges {
|
390
|
-
node {
|
391
|
-
... ProductFields
|
392
|
-
}
|
393
|
-
}
|
394
|
-
pageInfo {
|
395
|
-
hasNextPage
|
396
|
-
endCursor
|
397
|
-
}
|
398
|
-
}
|
399
|
-
}
|
400
|
-
GRAPHQL
|
401
|
-
QUERY_WITH_CURSOR = <<~GRAPHQL
|
402
|
-
#{ProductFields::FRAGMENT}
|
403
|
-
|
404
|
-
query($cursor: String!) {
|
387
|
+
query($cursor: String) {
|
405
388
|
products(first: #{LIMIT}, after: $cursor) {
|
406
389
|
edges {
|
407
390
|
node {
|
@@ -421,7 +404,7 @@ class GetProducts
|
|
421
404
|
data = parse_data(response.data.products.edges)
|
422
405
|
|
423
406
|
while response.data.products.pageInfo.hasNextPage
|
424
|
-
response = execute(
|
407
|
+
response = execute(QUERY, cursor: response.data.products.pageInfo.endCursor)
|
425
408
|
data += parse_data(response.data.products.edges)
|
426
409
|
end
|
427
410
|
|
@@ -492,24 +475,7 @@ class GetProducts
|
|
492
475
|
QUERY = <<~GRAPHQL
|
493
476
|
#{ProductFields::FRAGMENT}
|
494
477
|
|
495
|
-
query {
|
496
|
-
products(first: #{LIMIT}) {
|
497
|
-
edges {
|
498
|
-
node {
|
499
|
-
... ProductFields
|
500
|
-
}
|
501
|
-
}
|
502
|
-
pageInfo {
|
503
|
-
hasNextPage
|
504
|
-
endCursor
|
505
|
-
}
|
506
|
-
}
|
507
|
-
}
|
508
|
-
GRAPHQL
|
509
|
-
QUERY_WITH_CURSOR = <<~GRAPHQL
|
510
|
-
#{ProductFields::FRAGMENT}
|
511
|
-
|
512
|
-
query($cursor: String!) {
|
478
|
+
query($cursor: String) {
|
513
479
|
products(first: #{LIMIT}, after: $cursor) {
|
514
480
|
edges {
|
515
481
|
node {
|
@@ -531,7 +497,7 @@ class GetProducts
|
|
531
497
|
end
|
532
498
|
|
533
499
|
while response.data.products.pageInfo.hasNextPage
|
534
|
-
response = execute(
|
500
|
+
response = execute(QUERY, cursor: response.data.products.pageInfo.endCursor)
|
535
501
|
response.data.products.edges.each do |edge|
|
536
502
|
block.call ProductFields.parse(edge.node)
|
537
503
|
end
|
@@ -567,30 +533,7 @@ class GetCollectionsWithProducts
|
|
567
533
|
COLLECTIONS_LIMIT = 1
|
568
534
|
PRODUCTS_LIMIT = 25
|
569
535
|
QUERY = <<~GRAPHQL
|
570
|
-
query {
|
571
|
-
collections(first: #{COLLECTIONS_LIMIT}) {
|
572
|
-
edges {
|
573
|
-
node {
|
574
|
-
id
|
575
|
-
title
|
576
|
-
products(first: #{PRODUCTS_LIMIT}) {
|
577
|
-
edges {
|
578
|
-
node {
|
579
|
-
id
|
580
|
-
}
|
581
|
-
}
|
582
|
-
}
|
583
|
-
}
|
584
|
-
}
|
585
|
-
pageInfo {
|
586
|
-
hasNextPage
|
587
|
-
endCursor
|
588
|
-
}
|
589
|
-
}
|
590
|
-
}
|
591
|
-
GRAPHQL
|
592
|
-
QUERY_WITH_CURSOR = <<~GRAPHQL
|
593
|
-
query ($cursor: String!) {
|
536
|
+
query ($cursor: String) {
|
594
537
|
collections(first: #{COLLECTIONS_LIMIT}, after: $cursor) {
|
595
538
|
edges {
|
596
539
|
node {
|
@@ -618,7 +561,7 @@ class GetCollectionsWithProducts
|
|
618
561
|
data = parse_data(response.data.collections.edges)
|
619
562
|
|
620
563
|
while response.data.collections.pageInfo.hasNextPage
|
621
|
-
response = execute(
|
564
|
+
response = execute(QUERY, cursor: response.data.collections.pageInfo.endCursor)
|
622
565
|
data += parse_data(response.data.collections.edges)
|
623
566
|
end
|
624
567
|
|
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: 1.
|
4
|
+
version: 1.2.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: 2023-
|
11
|
+
date: 2023-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|