Querry to search for all products

im trying to search all products in some store, the piece of code that do that is this:


for(let i = 0; i < 2; i++ ){

resProds[resProds.length] = await client.query({
data: queryProds,
variables: { cursor: cursorProds}
})
cursorProds = resProds[resProds.length - 1].body.data.products.pageInfo.hasNextPage != true ? resProds[resProds.length - 1].body.data.products.pageInfo.endCursor : null

}

the response of this is always the same, it never changes, even if i put the next cursor on cursor as a string, and i dont know why, dont know even how to debug this, could someone help me?

Hey @Censoretti - could you let us know which queries you’re making (for example, how the queryProds object is defined in your code, are you using GraphQL/REST)? If you can share the response you’re receiving (with any shop-sensitive details edited out), that would be helpful as well. Without knowing too much about the way you’ve built the specific Product API queries, we’re unable to look into this too deeply, but if you’re able to share the above information, we’re happy to take a closer look.

Hope to hear from you soon!

Al | Shopify Developer Support