Storefront API - Customer Orders Query - Not working as expected

Storefront API - Customer Orders Query - Not working as expected

Ridge1388
Shopify Partner
6 0 0

I'm running a Storefront query to get data on a specific customer order, but the query doesn't appear to returning as expected.

 

The query is below:

 

query($query: String!, $token: String!) {
                customer(customerAccessToken: $token) {
                    orders(query:$query, first:1){
                        edges {
                            node {
                                id
                                name
                                orderNumber
                                processedAt
                                financialStatus
                                fulfillmentStatus
                                totalPrice {
                                    amount
                                    currencyCode
                                }
                            }
                        }
                    }
                }
            }

 

 

The Variables I am adding are:

 

{ token: '***', query: 'name:#4214' }

 

 

I've tried this on the Admin API and I get order #4214 as I'd expect, however on Storefront, it seems to be ignoring the "$query" portion completely. 

 

It returns:

 

 

[
  {
    node: {
      id: 'gid://...',
      name: '#2356',
      orderNumber: 2356,
    }
  }
]

 

 

Is this a known issue or an I doing something wrong here?

 

Thanks!

Replies 0 (0)