MONEI / Shopify-api-node

Node Shopify connector sponsored by MONEI
https://monei.com/shopify-payment-gateway/
MIT License
946 stars 278 forks source link

Shopify-api-node cursor based pagination #465

Closed kamranblueeast closed 3 years ago

kamranblueeast commented 3 years ago

Actually I have tried shopify-api-node with both plain JS as well with typscript, with plain JS I can see the next page and unique tokens but with typescript I am unable to get next page and unique tokens. Any advise?

kamranblueeast commented 3 years ago

I am using updated version "shopify-api-node": "^3.6.5". My shopify config objcet is as.. const shopify: Shopify = new Shopify({ apiVersion: '2020-10', shopName: "test", apiKey: "test", password: "test", autoLimit: { calls: 2, interval: 3000, bucketSize: 30 },

});
With this config object shopify.list() API returned Response code 400 (Bad Request)
Any advise?
kamranblueeast commented 3 years ago

Shopify config object does not accepts page_info. const params = { limit, fields: 'id,created_at,name,email,number,tags,currency,total_price,line_items,shipping_address,billing_address, shipping_lines, order_number, cancelled_at, subtotal_price,gateway', updated_at_min: previousDate1, updated_at_max: currentDate1, order: 'created_at desc', page_info:'xxxxxx' }; Whenever I tried to pass page_info key value It returns Bad Request(400)

kamranblueeast commented 3 years ago

When I pass updated_at_min, updated_at_max and page_info with shopify objcet it gives bad request but whenever I pass page_info without updated_at_min, updated_at_max it works fine.

lpinca commented 3 years ago

@kamranblueeast read https://shopify.dev/tutorials/make-paginated-requests-to-rest-admin-api and see https://github.com/MONEI/Shopify-api-node/issues/382#issuecomment-632303199 for a working example.

lpinca commented 3 years ago

I'm closing this as answered. Discussion can continue if needed.