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!