A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
I have multiple sales channels on my store. Given a product id, how do I find all the sales channel enabled for that given product via API?
API can be REST or GraphQL.
Solved! Go to the solution
This is an accepted solution.
Hi Jayaraj,
Thanks for your post. This is possible using a GraphQL query such as the one below, noting that the 'read_publications' scope is required which is currently available only to custom apps installed on Shopify Plus stores and which needs to be added by Partner Support by request.
The query:
query {
product(id: "gid://shopify/Product/12345") {
resourcePublications(first: 10) {
nodes {
isPublished
publication {
name
id
}
}
}
}
}
Some related documentation:
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
This is an accepted solution.
Hi Jayaraj,
Thanks for your post. This is possible using a GraphQL query such as the one below, noting that the 'read_publications' scope is required which is currently available only to custom apps installed on Shopify Plus stores and which needs to be added by Partner Support by request.
The query:
query {
product(id: "gid://shopify/Product/12345") {
resourcePublications(first: 10) {
nodes {
isPublished
publication {
name
id
}
}
}
}
}
Some related documentation:
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog