Skip to content

Commit a82682c

Browse files
piehsidharthachatterjee
authored andcommitted
fix(gatsby-source-shopify): fix query pagination (#11752)
1 parent 79fc737 commit a82682c

File tree

1 file changed

+4
-3
lines changed
  • packages/gatsby-source-shopify/src

1 file changed

+4
-3
lines changed

packages/gatsby-source-shopify/src/lib.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ export const queryAll = async (
3939
path,
4040
query,
4141
first = 250,
42-
after,
43-
aggregatedResponse
42+
after = null,
43+
aggregatedResponse = null
4444
) => {
4545
const data = await queryOnce(client, query, first, after)
4646

@@ -51,7 +51,7 @@ export const queryAll = async (
5151
? aggregatedResponse.concat(nodes)
5252
: nodes
5353

54-
if (get([...path, `pageInfo`, `hasNextPage`], false, data))
54+
if (get([...path, `pageInfo`, `hasNextPage`], data)) {
5555
return queryAll(
5656
client,
5757
path,
@@ -60,6 +60,7 @@ export const queryAll = async (
6060
last(edges).cursor,
6161
aggregatedResponse
6262
)
63+
}
6364

6465
return aggregatedResponse
6566
}

0 commit comments

Comments
 (0)