Making the below call in GraphQL to determine the first and last order for a customer.
I have also included the result below the query. Note that the request is for customer id 7178920099883, but when retrieving the lastOrder for that customer it returns an order from a different customer id (7178816323627).
Has anyone seen this? Any ideas on what might be happening?
{ customer(id: "gid://shopify/Customer/7178920099883") {
id,
displayName,
email
locale
lastOrder {processedAt, id, name, customer {id,displayName,email}}
numberOfOrders
amountSpent{amount}
orders(first: 1, sortKey:PROCESSED_AT) {
edges {
node {
processedAt
}
}
}
}
}
It returns the following (PII redacted by me):
{
"data": {
"customer": {
"id": "gid://shopify/Customer/7178920099883",
"displayName": *******,
"email": null,
"locale": "en",
"lastOrder": {
"processedAt": "2024-11-05T23:53:06Z",
"id": "gid://shopify/Order/5492235370539",
"name": "#904099",
"customer": {
"id": "gid://shopify/Customer/7178816323627",
"displayName": *****,
"email": *****
}
},
"numberOfOrders": "1",
"amountSpent": {
"amount": "281.89"
},
"orders": {
"edges": []
}
}
},
"extensions": {
"cost": {
"requestedQueryCost": 6,
"actualQueryCost": 5,
"throttleStatus": {
"maximumAvailable": 20000.0,
"currentlyAvailable": 19995,
"restoreRate": 1000.0
}
}
}
}