Filter orders using AND operator

AI-generated summary

  • Goal: Retrieve orders that are not tagged with two specific tags simultaneously (NOT “first tag” AND NOT “second tag”).
  • Solution: Use ShopifyQL via the GraphQL Admin API to filter orders with combined NOT conditions on tags.
  • Example (central code snippet): orders(query: “NOT tagged:‘first tag’ AND NOT tagged:‘second tag’”) { edges { node { id tags } } }.
  • Outcome: Returns a list of orders (IDs and tags) that exclude both tags.
  • Notes: Approach is API-based; no storefront or UI filter method was provided.
  • Status: The provided query addresses the request; no unresolved issues raised.

Hi,

How can I filter orders to get a list with all orders that doon’t include 2 tags

(Not tagged with “first tag” AND Not tagged with “Second tag”)

Thanks in advance

Hi,

You can try ShopifyQL via GraphQL API

Example Query

{
  orders(query: "NOT tagged:'first tag' AND NOT tagged:'second tag'") {
    edges {
      node {
        id
        tags
      }
    }
  }
}