I want to display the list of returns for a store in a table with pagination control. As I understand, this requires using the Shopify GraphQL API to get returns.
I know returns can be queried under orders, simple example (I’ve omitted the cursor controls for simplicity):
But I want to display say 10 returns per paginated page and not every order has a return.
How do I add the condition that only orders that have at least 1 return line item should be returned in the query response?
Furthermore, since it seems that it is possible that an order can have more than 1 return, how can I ensure that for each GraphQL query I get exactly 10 return line items (assuming that there is another page of returns after the current cursor, the last page of course could have fewer items than the page size).
I added partially_refunded to the query and that is working, i.e.
query: “financial_status:refunded,partially_refunded”
I need to also get returns that are in progress though. This status does not appear in the list for financial_status likely since it applies to the return and not the order.
Any ideas on how to also get the returns that are in progress? I need to get all types of returns
I think that provides what I was looking for. The Shopify GraphQL API is a bit strange though as you need to put returnStatus = “IN_PROGRESS” as you highlighted but the API response returns “OPEN” for the return object status instead of “IN_PROGRESS”.