shopify_graphql 1.1.1 → 1.2.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/README.md +6 -63
- 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: '028218d246ffa0ba8a2e65131c5abf7f9b70f1030818d41ed17e07dafd4ae273'
|
|
4
|
+
data.tar.gz: 703a8d3c95b26c26ca500016aa3f68057a6e25cd9afef55d89b5e9aaea17d61f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 78cbd2465f2803330e6427539a9ca7dccdccdeab7d17bf9556f1d34e3b1dc0bd6a29d0fd6bbfb2b08276e2e2cf49957f2b420745bfa8dddaf090494e194c54dd
|
|
7
|
+
data.tar.gz: 947365b6f1c8042ee08071dc548506875c9810b1337b2b7ebc0114365e238d2ad046e9f7604b023a5baf26382db09e002cc77a3ff22e80643abfa7060738872c
|
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.0
|
|
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-07-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|