Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

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

Company Orders received an error "Query not supported."

Company Orders received an error "Query not supported."

berryprana
Shopify Partner
1 0 0

 

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!

Replies 0 (0)