Storefront API empty result set when combining `tag` & multiple `vendor` terms in a query.

FactoryAidan
Tourist
9 1 2

Why did I post?

I believe there's a bug in the Storefront API (and all of Shopify's backend) that causes an empty result set when there shouldn't be.

Back-story:

My Shop essentially sells tickets to attend an event. Those tickets are my Products that I sell. The Product has a date associated with when the event is. I've built a UI where customers can filter & sort these events by date and I simply query the Storefront API with the user's search parameters.

My setup:

I have set up my Products so the `Product.vendor` property is populated with a date string in `YYYY-MM-DD` format to support string-based comparison. I am able to filter and sort by that date string easily with the variations of the following GraphQL query:

 

 

{
	products(
		first: 250,
		sortKey: VENDOR,
		reverse: false,
		query: "vendor:>='2021-04-01' AND vendor:<='2021-06-01'"
	){
		edges {
			node {
				handle
				id
				vendor
				tags
			}
		}
	}
}

 

 

Yeah, and... ?

So I want to also narrow those results by Product tag. And that's where it breaks.

query: "vendor:>='2021-04-01' AND vendor:<='2021-06-01' AND tag:'location::Online'"

This returns an empty result set:

[]

Always, no matter what, no Products ever show regardless of the query values used.
However I've checked, rechecked, and quintuple checked that I do have products that fit those query parameters.
I've tried all Storefront API versions past `2022-01` and even other Shopify APIs and all of them have this behavior.

"Yeah, right dude. You don't know how to Shopify; you're just confused about your own store."

"Oh, am I?"

So I tried the following query strings that all work perfectly:

  • "tag:'location::Online'"
  • "vendor:>='2021-04-01' AND vendor:<='2021-06-01'"
  • "vendor:<='2021-06-01' AND tag:'location::Online'"
  • "vendor:>='2021-04-01' AND vendor:<='2021-06-01' AND product_type:'class'"

Some things to point out:

  • The second one works perfectly; where there's a range of `vendor` values. So you can't tell me I can't have two `vendor` terms in a single query.
  • The third one works perfectly; where there's a combination of `vender` & `tag` filtering. So you can't tell me that `vendor` & `tag` can't be combined in a query.
  • The last one works perfectly; where there's a combination of a `vendor` value range & `product_type`. So you can't tell me I can't have two `vendor` terms with additional terms.

Hmm. Does the browser-based Shopify Admin behave the same way?

Yes, it does. Exactly the same behaviors as all of the above are present when using the Shopify Admin web-browser-based interface.

It is always true that when I try to filter by a range of `vendor` values at the same time I'm filtering by `tag`, I always get an empty result set.

So, what's the plan here, Shopify?

The only place where there could be any room for error on my part is if I need to group my query terms with parenthesis or swap `AND` for `OR` logic. However:

  • There's no way using `OR` here makes sense for this query; remember the purpose here is to further narrow the results by using additional terms.
  • I've already tried all the combinations of grouping terms with parenthesis that are possible. There is no change in the behavior.

So I've decided this has to be a bug (a platform-wide bug not specific to just one API). I need either the community to tell me I missed something or Shopify to address the issue.

Replies 0 (0)