In REST API it was possible to filter products list by collection like this:
ShopifyAPI::Product.all(collection_id: "...")
We have similar filter on productVariants query in Graphql:
But for some reason this filter is not available for products and productsCount queries:
It is possible to get products using collection query, but it doesn’t supports product filtering by status, so it’s not a viable replacement for an old REST approach.
This is critical issue for us, as it doesn’t allows us to fully migrate to the new products API and the deadline is approaching quickly.
There’s no query argument on products connection inside collection resource. And I had issue with collection resource returning empty product list randomly so can’t really trust it.
After connecting with the Products API team on this, we’ve recorded this limitation and will work on a fix. I don’t have an ETA to share right now, but will update here once available.
@Liam-Shopify Any chance it will be fixed before the deadline for Graphql products API migration (2025-02-01)? Not much time left and I don’t see any workaround to complete migration.
@Liam-Shopify any update on this? API v2025-01 still doesn’t have the filter and we don’t have time left to wait for the fix. I guess now the only option is to use products from collection resource and filter products on the backend?
The only update I can give on this is that our devs are currently working on releasing the required filter, but there’s no ETA to share on this as of today. I’m following the progress of this and will update here once it’s available.
Just to understand, we are talking about passing in the collection id as a possible query parameter in the products query, or being able to pass the query parameter in the products connection of the collection query?