I used the GraphQL API to query the product saleschannel, but it didn’t take effect. Is it because my calling method is incorrect? Can someone give me accurate guidance
query products($first:Int, $queryStr: String){
products(first: $first, reverse: true, sortKey: UPDATED_AT query: $queryStr) {
edges {
node {
id
title
resourcePublications(first: 50, onlyPublished:false){
edges{
node{
isPublished
channel{
app {
id
title
}
}
}
}
}
}
}
}
}
variables:
{
"first": 1,
"queryStr": "publishable_status:online_store_channel"
}
1 Like
Hey @kyle_liu!
Looking at your post, I think we may need a little more context. Can you share what results you’re expecting to see versus what you’re actually getting back? For example, are you getting all products returned when you should be getting a filtered subset, or are you getting no results at all?
In the meantime, I’d recommend adding the search syntax debugging headers to your request to get a clearer picture of how your query is being parsed. Just add Shopify-Search-Query-Debug: 1
to your request headers.
Hi @KyleG-Shopify
I hope to query products that have been published to the online store on the sales channel, but in the queried data, products that have not been published to the online store can still be queried.
x-request-id:
d0f2ee4a-130d-4f58-b30c-efa608aaa2a2-1749691101
Thanks Kyle. Just looking closer, this does seem similar to this issue reported here: Filtering products by querying publication_status to a sales channel app does not work
Since that issue hasn’t yet been resolved, have you tested some of the other fields like product_publication_status or publication_ids to see if they will work?
Yes, using ID is possible, but it would be even better if name could be used. I hope Shopify can fix it as soon as possible
1 Like