Headless commerce and custom storefronts with Shopify APIs and SDKs
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.
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.
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
}
}
}
}
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.
"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:
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.
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:
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.
We're excited to announce improvements to the threaded messaging experience in our communi...
By TyW May 31, 2023Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...
By Jacqui May 30, 2023Photo by Marco Verch Sales channels on Shopify are various platforms where you can sell...
By Ollie May 25, 2023