Thanks for your post. Currently there’s not a built in way to achieve that in a single query so we’ve submitted some feedback about it internally, particularly around having some more filters in the Collection.products connection.
It’s true, but I am using C#, and because of that I can just use LINQ to filter the returned data super quick.
Don’t know what technology you are using, but maybe it has something similar
This should be possible now by using the productVariants graphql query.
For example:
query getProductVariantsByCollection {
productVariants(query:"collection:{your-collection-id} status:ACTIVE" first:10) {
nodes {
id
sku
product {
title
}
}
}
}
This will give you all of the active products for a specific collection id. The collection id you send in is just the number and not the gid. Hope this helps.