Discuss all the new features introduced with the new product model in GraphQL.
Given that the REST product APIs are going away, how would we list products in a specific collection? The REST list products endpoint supported a collectionId filter.
The graphQL Collection query doesn’t return products. And the graphQL products query doesn’t support a collectionId.
Hi @roymap
This one works with collection ID
{
node(id: "COLLECTION_ID") {
... on Collection {
id
title
description
handle
updatedAt
products(first: 5) {
edges {
node {
id
title
}
}
}
}
}
}
Result here:
Hi, there
You could refer to this graphQL and change the id of specifed collection d
query {
collection(id: "gid://shopify/Collection/451514401051") {
products(first: 10) {
edges {
node {
id
title
description
priceRange {
minVariantPrice {
amount
currencyCode
}
maxVariantPrice {
amount
currencyCode
}
}
}
}
}
}
}