Closed liqueflies closed 4 years ago
Update: Tried into sanity playground:
{
allShopifyProduct(where: { _: { references: "fC2enKhGoDy6FwhgsPjK7e" } } ) {
_id
title
collections {
title
handle
}
}
}
and it's working.
It's an issue related to gridsome or the source plugin that i am using?
Hi Lorenzo, sorry for the slow response ~
I use the latter _: { references: "..." }
when I need to do a query like this. An unfortunate result of this, though, is that the products return do not match with the way they are ordered within that collection.
Unfortunately, deeper filtering (like you mention with products { # products(...) ordering, filtering... etc
) is a limitation from Sanity's GraphQL API - you can only do filtering & sorting on the top-level query ☹️ Hopefully this is something they are working on.
I have a project that includes filter/sorting/search functionality -- and I've found that the only way to do more complicated things is to use GROQ.
I'm going to close this since it's really an issue with Sanity's GraphQL API and not specific to this project - but feel free to continue the discussion.
Hello!
I am facing an issue when I'm trying to filter products by it's collection, here an example:
it returns no-results.
Also is not possible to filter products inside collection IE.
The second one is not important instead the first. FYI I am using gridsome :)
Thank you again <3
Lorenzo