Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello,
I'm trying to obtain the number of orders that a customer has made and we've fulfilled. I've tried using the 'numberOfOrders' attribute but this also counts orders that have been created but not yet fulfilled.
Is there an easy way to obtain this number without having to make a paginated GraphQL query that filters by fulfillment_status and customer_id?
Thank you in advance
Hi,
Hope this will help
GraphQL query
{
customer(id: "CUSTOMER_ID") {
orders(query: "fulfillment_status:fulfilled") {
totalCount
}
}
}
Replace "CUSTOMER_ID" with the actual ID
Thank you for your answer, but this returns the following error:
"message": "Field 'totalCount' doesn't exist on type 'OrderConnection'"
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025