A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi everyone,
I haven't made any code changes recently, but when I run the following query now, Shopify response many errors, which didn't happen before. For Example,
message "
Field 'ordersCount' doesn't exist on type 'Customer" but in the API document there is a
orders Count field for the Customer object.
I cant figure out why this is happened, please tell me where the problem is.
Thank you for your support!
Request Body ====
{
"query": "query { customer(id: \"gid://shopify/Customer/6868074889508\") { firstName hasNote hasTimelineComment id lastName legacyResourceId note ordersCount phone state tags taxExempt totalSpent totalSpentV2 {amount } } }"
}
Response Body ====
{
"errors": [
{
"message": "Field 'ordersCount' doesn't exist on type 'Customer'",
"locations": [
{
"line": 1,
"column": 115
}
],
"path": [
"query",
"customer",
"ordersCount"
],
"extensions": {
"code": "undefinedField",
"typeName": "Customer",
"fieldName": "ordersCount"
}
},
{
"message": "Field 'hasNote' doesn't exist on type 'Customer'",
"locations": [
{
"line": 1,
"column": 127
}
],
"path": [
"query",
"customer",
"hasNote"
],
"extensions": {
"code": "undefinedField",
"typeName": "Customer",
"fieldName": "hasNote"
}
}
]
}
HI Andy,
its not ordersCount its numberOfOrders, its also not hasNote but just note
See the object definition: https://shopify.dev/docs/api/admin-graphql/2023-04/objects/customer