Hi @sengming ,
I’d try to explain the difference between the the status and published_status fields of the Product resource, and hopefully I can clarify any confusion you have.
For the Rest API,
-
the
statusfield of a Product resource indicates the product status. Possible values are active, draft, or archived. -
the
published_statusof a Product resource indicates what channel the product is available on. Using the values published, unpublished, or any, the channel used is the online store. There is flexibility to select products from a specific channel also. You can use the following[channel_name]:[hidden|visible]as the value (the value should be url encoded). For example finding all products published on the Buy Button channel would use/admin/api/2020-10/products.json?published_status=buy_button%3Avisible(url encoded).
To answer your question about how to query for products that have an active status using GraphQL, see the example below
{
products(first:10, query: "status:active") {
edges {
node {
id
status
}
}
}
}
I hope this helps, and the differences between the status and published_status fields are clearer now.
Best,
Seth.