Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This enables usage of pagination for orders and products #447

Closed
wants to merge 3 commits into from

Conversation

LarsBuur
Copy link

No original work here. It´s basically what @YourWishes suggests in #288.
Could and should be extended throughout the api for lists.

Usage example:

  const orderList: IOrder[] = [];
  const orderStatus = 'any';

  let params = { status: orderStatus, limit: 250 };

  do {
    const orders = await shopify.order.list(params);

    for (const order of orders) {
      orderList.push(order);
    }

    params = orders.nextPageParameters;
  } while (params !== undefined);

  console.log(`after while loop len:${orderList.length}`)

No original work here. It´s basically what @YourWishes suggests in MONEI#288.
Could and should be extended throughout the api for lists.

Usage example:
```
  const orderList: IOrder[] = [];
  const orderStatus = 'any';

  let params = { status: orderStatus, limit: 250 };

  do {
    const orders = await shopify.order.list(params);

    for (const order of orders) {
      orderList.push(order);
    }

    params = orders.nextPageParameters;
  } while (params !== undefined);

  console.log(`after while loop len:${orderList.length}`)
```
@coveralls
Copy link

coveralls commented Dec 19, 2020

Coverage Status

Coverage remained the same at 100.0% when pulling bf13260 on LarsBuur:master into a0cdad6 on MONEI:master.

@dankeller101
Copy link

Just wanted to drop in to say this would be very helpful for us on our project that depends on this wrapper! Let me know if there's any way I can help make this land sooner.

@davidmm07
Copy link

@lpinca Check this PR

@lpinca
Copy link
Collaborator

lpinca commented Mar 29, 2021

It should be done for all supported endpoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants