A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi,
I'm trying to export orders using the bulkOperation but I'm not being able to export the orders with line items
I also would like to see the lineItemId on the Refund list.
Here's my query:
mutation { bulkOperationRunQuery(query: """ { orders { edges { cursor node { id email closedAt createdAt processedAt name test lineItems { edges { node { id quantity originalUnitPriceSet { shopMoney { amount } } totalDiscountSet { shopMoney { amount } } fulfillmentStatus variant { id title } product { id title } } } } publication { id name app { id title } } totalPriceSet { shopMoney { amount } } subtotalPriceSet { shopMoney { amount } } totalTaxSet { shopMoney { amount } } totalDiscountsSet { shopMoney { amount } } totalRefundedSet { shopMoney { amount } } totalShippingPriceSet { shopMoney { amount } } cancelReason cancelledAt currencyCode displayFinancialStatus displayFulfillmentStatus tags shippingLine { code } physicalLocation { id name } billingAddress { city provinceCode country } discountCode customer { id email phone firstName lastName } shippingAddress { city provinceCode country } customer { id displayName email firstName lastName tags phone } refunds { id createdAt totalRefundedSet { shopMoney { amount } } } } } pageInfo { hasNextPage } } } """) { bulkOperation { id status } userErrors { field message } } }
Hey Sergio,
To help you save time, we've explored exports in different ways and iterating of GraphQL was the "best" one but they're all incredibly slow. We sometimes need 3 days to download our customer's entire dataset (Orders + Line Items + Refunds).
The Bulk operation doesn't seem to be faster, it just allows you not to have to manage the API quotas, but you still have to wait and check for the batch to be done. Since we experience 500 server errors on Shopify side when querying large amounts of data, our solution has been to download everything in smaller chunks.
Depending on what you're looking to do, maybe we can help with https://apps.shopify.com/peel-insights
And if not, let me know what error message you are receiving. Maybe I can help but the query seems like it should work
Best
Hi Nicolas, thanks for your reply, I understand your pain, we've been dealing with the same problems, lots of 500, 250 items returning in 20 seconds and so on. Would the Bulk operation be able to export Line Items? because when I check the orders exported, none of them have line items on the jsonl file.
Edit: I found the Line items on the file, they aren't in the same line as the order, they are on subsequent lines
Hey Sergio, I was going to reply that the bulk export will return nested objects separately, so the line items, products, etc. will not be in the orders' file.
Out of curiosity, is the bulk export any faster?
Thanks again for you answer Nicolas.
I'm not sure yet, but by reducing the number of API calls I can assume it will be significantly faster.