robwittman / shopify-php-sdk

PHP SDK for development with the Shopify API
MIT License
65 stars 41 forks source link

Support cursor-based pagination #48

Open bogdanghervan opened 4 years ago

bogdanghervan commented 4 years ago

Shopify has removed support for page-based pagination and enforces that everybody moves to cursor-paged pagination.

The library doesn't seem to provide a way to access the response headers, at least when using the services.

JelleDijkhuizen commented 4 years ago

HI @bogdanghervan i create this function to get the code from the api ` /**

Then i call the function with this: $this->getCodeFromLinkHeader($this->api_response->getHeader('link')[0]);

And to get the api response i use Shopify\Service\ProductService->getLastResponse() to set the api_response. Every Services class has the getLastReponse function to get the headers.

bogdanghervan commented 4 years ago

Thanks, @JelleDijkhuizen, perhaps this can help somebody else stumbling upon this thread.

I ended up starting a migration project to a different Shopify client library.