Hi everybody, I’m trying to get published products from Storefront API but it returns unpublished products. Is it a bug? Or something wrong with query?
here is my query
{
products(first: 1, query: "published_status:published") {
edges {
cursor
node {
id
title
handle
onlineStoreUrl
vendor
variants(first: 1) {
edges {
node {
title
image {
src
}
price
}
}
}
}
}
}
}
I also need to get products by Collections but I cannot add query in products, how do I get published products filter by a collection? This query gives error.
{
collectionByHandle(handle: "HANDLE") {
products(first:1, query: "published_status:published") {
edges {
cursor
node {
id
title
handle
onlineStoreUrl
variants(first: 1) {
edges {
node {
title
image {
src
}
price
}
}
}
}
}
}
}
}



