A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
I want to sort the company orders based on the total price.
Query :
query CompanyOrders($companyId: ID!, $before: String, $after: String, $first: Int, $last: Int, $businessSortKey: OrderSortKeys, $reverse: Boolean!) { company(id: $companyId) { id name orders( first: $first last: $last before: $before after: $after sortKey: $businessSortKey reverse: $reverse ) { edges { node { createdAt name customer { displayName } } } } } }
Variables :
{
"companyId": "gid://shopify/Company/*********",
"first": 50,
"businessSortKey": "TOTAL_PRICE",
"reverse": true
}
But I received an error message 'Query not supported.' and strangely when I use the "CREATED_AT" key it works.
even though in docs, sortKey for "TOTAL_PRICE" is available.
"errors": [ { "message": "Query not supported.", "locations": [ { "line": 5, "column": 5 } ], "path": [ "company", "orders" ] } ],
Is there something wrong with how I'm implementing the GraphQL variable?"
Any tips would be highly appreciated!