Why is this product query filter not working?

Topic summary

A user encountered an issue with a GraphQL product query filter that wasn’t excluding ARCHIVED products despite specifying status:active. They tried multiple variations including ACTIVE and active without success.

Solution provided:

  • The filter syntax should use lowercase: query: "status:active"
  • This was confirmed to work correctly, filtering out archived products as expected

Resolution:
The issue was resolved after correcting the query syntax. The original poster confirmed the solution worked and appreciated the help in identifying what turned out to be a syntax error in their filter implementation.

Summarized with AI on November 8. AI used: claude-sonnet-4-5-20250929.

I’ve added a query filter to this request to filter for ACTIVE products, yet it does not affect the results which include ARCHIVED as well as ACTIVE etc.

I’ve tried using ACTIVE and active and some variations but no luck.

Can anyone tell me what I’m doing wrong?

query GiftFinderData {
  products(first: 10, query:"product_status:active") {
    edges {
      node {
        id
        title
        status
        descriptionHtml
        variants(first: 10) {
          edges {
            node {
              title
              price
              legacyResourceId
            }
          }
        }
      }
    }
  }
}

It should work with this:

query GetActiveProducts {
  products(first: 10, query: "status:active") {
    edges {
      node {
        id
        title
        status
        totalInventory
        priceRangeV2 {
          minVariantPrice {
            amount
            currencyCode
          }
          maxVariantPrice {
            amount
            currencyCode
          }
        }
      }
    }
  }
}

using query: "status:active"

I tested it, and archived products are not appearing for me now.

1 Like

That’s it, thank you @Liam - feel like a bit of an idiot missing this but your response has helped me figure out why I got this wrong too and a big part of this has clicked for me so I appreciate it.

Great to hear!