When getting collection detail from api, I want get list of products in that collection. Everything seem good, but the result does not have image url as I expected.
query GetCollectionDetail($id: ID!, $options: ProductVariantListOptions!){
collection(id: $id) {
id
name
productVariants(options: $options) {
totalItems
items {
id
sku
name
price
assets {
source
preview
}
}
}
}
}
Variables:
{
"id": "3",
"options": {
"skip": 0,
"take": 5
}
}
Hi, I cannot reproduce this. Can you provide more details - vendure core version, the response you receive, etc.
Hi @michaelbromley ,
Please take a look in the attached screenshot.

I've tried on https://demo.vendure.io/shop-api GraphQL playground.
The response as below:
{
"data": {
"collection": {
"id": "3",
"name": "Computers",
"productVariants": {
"totalItems": 25,
"items": [
{
"id": "1",
"sku": "L2201308",
"name": "Laptop 13 inch 8GB",
"price": 129900,
"assets": []
},
{
"id": "2",
"sku": "L2201508",
"name": "Laptop 15 inch 8GB",
"price": 139900,
"assets": []
},
{
"id": "3",
"sku": "L2201316",
"name": "Laptop 13 inch 16GB",
"price": 219900,
"assets": []
},
{
"id": "4",
"sku": "L2201516",
"name": "Laptop 15 inch 16GB",
"price": 229900,
"assets": []
},
{
"id": "5",
"sku": "TBL200032",
"name": "Tablet 32GB",
"price": 32900,
"assets": []
}
]
}
}
}
}
This is because those ProductVariants do not have any assets assigned to them. That's why the array is empty. You can try assigning an asset to the Laptop 13 inch 8GB variant and then try again to check.
Thanks @michaelbromley. It worked.
I will close this issue.