Issue with products query when trying to filter by empty product_type AND tag

DanAtBonify
Shopify Partner
55 4 32

I am trying to filter products that DO NOT have a product_type set (empty) and that has a specific tag. Example query:

 

{
  products(first: 10, query: "tag:testing_this_out AND NOT product_type:*") {
    edges {
      node {
        title
        productType
        tags
      }
    }
  }
}

That query does not return valid products.

 

Other attempts, testing with two products, one that SHOULD show up, and another product that should NOT show up.

 

  • tag:testing_this_out
    • Good: Returns 2 products as expected.
  • tag:testing_this_out AND NOT product_type:*
    • Returns 0 products.
    • Expected 1 product returned.
  • tag:testing_this_out AND product_type:''
    • Returns 0 products.
    • Expected 1 product returned.

 

So at this point I am not sure how to do this...

Replies 3 (3)

DanAtBonify
Shopify Partner
55 4 32

Can someone from Shopify confirm if bug or feature? 

sinemtopcu
Shopify Partner
3 0 0

I am also looking for a solution to this for hours, nothing worked yet.

sinemtopcu
Shopify Partner
3 0 0

I was able to filter on my shop like this
products?selectedView=all&product_type="