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.

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

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

DanAtBonify
Shopify Partner
57 4 43

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
57 4 43

Can someone from Shopify confirm if bug or feature? 

sinemtopcu
Shopify Partner
11 0 2

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

sinemtopcu
Shopify Partner
11 0 2

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