The Shopify documentation for the Products API endpoint does not provide an option to filter products directly by collection. While you can use collectionByHandle
to retrieve products from a specific collection, there is no built-in way to fetch products that belong to multiple collections in a single query.
query getProducts($first: Int) {
products(first: $first) {
edges {
cursor
node {
title
}
}
}
}