Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
I am trying to get orders by customer ID. Here is the code I am using:
const orders = await client.query({
data: `{
customer(id:${customerId}){
firstName
lastName
orders(first:50, reverse:true){
edges{
node {
id
createdAt
currentSubtotalLineItemsQuantity
}
}
}
}
}`
});
It returns the customer first and last name, but after orders, edges the node information doesn't appear. The same query works in the shopify graphQl app.
"body": {
"data": {
"customer": {
"firstName": "Jane",
"lastName": "Jane",
"orders": {
"edges": []
}
}
},
Thank you for any help.
Stephen
Solved! Go to the solution
This is an accepted solution.
I figured it out thanks. Needed to request read access for orders over 60 days.
This is an accepted solution.
I figured it out thanks. Needed to request read access for orders over 60 days.
User | RANK |
---|---|
6 | |
5 | |
5 | |
4 | |
4 |