Shopify / shopify-app-js

MIT License
228 stars 91 forks source link

Retrieve pagination infos concerning Collection products #768

Open daweido opened 7 months ago

daweido commented 7 months ago

Issue summary

Hi there,

There is something I don't really understand in the way you guys have implemented the products retrieval for Collections. I have seen that pagination has been implemented in the majority of your endpoints. Concerning the products retrieval for Collections, on your REST API documentation it is stated that:

Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header.

However in this file: https://github.com/Shopify/shopify-api-js/blob/main/packages/shopify-api/rest/admin/2023-10/collection.ts#L75

On this line: return response ? response.body : null;, it seems that you disable us the possibility of retrieving any information concerning the pagination which in the case of your API limiting the results to 250 items is very frustrating knowing that I have collections with over 1000s products.

Is there a reason for such choice? Is it a mistake? Or is there another way of retrieving pagination info, thus enabling us to browse through the pages to retrieve all the products from a given a collection (which is the MAIN purpose of this endpoint.)?

After changing return response ? response.body : null; to return response ? response : null; locally I have access to all pagination info.

Expected behavior

When querying a Collection's products, I should have access to the pagination info.

Actual behavior

Only have access to the data, limiting me to retrieving only 250 products max.

lizkenyon commented 7 months ago

Hi there 👋

Thank you for the feedback, and I can confirm that this is an issue.

While we get to resolving this workarounds could be:

github-actions[bot] commented 5 months ago

This issue is stale because it has been open for 90 days with no activity. It will be closed if no further action occurs in 14 days.

github-actions[bot] commented 1 month ago

We're labeling this issue as stale because there hasn't been any activity on it for 60 days. While the issue will stay open and we hope to resolve it, this helps us prioritize community requests.

You can add a comment to remove the label if it's still relevant, and we can re-evaluate it.