Here is a small tip about Shopify's GraphQL Admin API.
When you want to get the total number of customers in Shopify, the query is not easy to find right away, so I am making a note of it here.
Target audience
- People who have used the Shopify GraphQL Admin API
Query to get the total number of customers
Because CustomerSegmentMemberConnection changed in version 2023-07, the query differs slightly before and after 2023-07. * changelog
2023-07 and later
{
customerSegmentMembers(first: 1, query: "") {
totalCount
}
}
Earlier than 2023-07
{
customerSegmentMembers(first: 1, query: "") {
statistics {
totalCount
}
}
}