Get orders by product ids, it's can but should I use ?

Get orders by product ids, it's can but should I use ?

anhdd_kuro
Tourist
5 0 0

Currently, I can retrieve orders by product IDs with this query

query GetOrdersByProductIds($query: String, $first: Int = 250) {
  orders(query: $query, first: $first) {
    edges {
      cursor
      node {
        id
        name
      }
    }
  }
}

{
  "query": "product_id:9068794282304,9108781072704"
}

However, it seems that product_id is not officially included in the search query list. Should I continue using it? Is there any other way to achieve this without filtering products inside line items?

Replies 0 (0)