Trying to get orders using graphQL node sdk but the information after edges doesn't appear.

Solved
stephenJCA
Tourist
4 1 1

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

Accepted Solution (1)

Accepted Solutions
stephenJCA
Tourist
4 1 1

This is an accepted solution.

I figured it out thanks.  Needed to request read access for orders over 60 days.

View solution in original post

Reply 1 (1)
stephenJCA
Tourist
4 1 1

This is an accepted solution.

I figured it out thanks.  Needed to request read access for orders over 60 days.