The new productsCount - GraphQL Admin API is not working
When I tried the following example cURL it is returning errors in the response.
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query { productsCount(query: \"id:>=1000\") { count } }"
}'
Response:
{
"errors": [
{
"message": "Field 'productsCount' doesn't exist on type 'QueryRoot'",
"locations": [
{
"line": 1,
"column": 9
}
],
"path": [
"query",
"productsCount"
],
"extensions": {
"code": "undefinedField",
"typeName": "QueryRoot",
"fieldName": "productsCount"
}
}
]
}
Even using the exact example Shopify docs is not working. So I’m not sure what I’m doing wrong here.