Publish product to all sales channels graphql

Solved

Publish product to all sales channels graphql

joao_a_costa
Shopify Partner
10 2 2

Hello,

 

I'm trying to publish a product to all sales channels (including Facebook) but there's no option in graphql for that. From what I've searched, there's no implementation for that. Is it possible? Does anyone succeed on this matter?

Accepted Solution (1)
joao_a_costa
Shopify Partner
10 2 2

This is an accepted solution.

Thank you for your reply.

 

It is indeed the solution.

 

First, get the channels list:

joao_a_costa_0-1675946079737.png

 

Then call 'publishablePublish':

joao_a_costa_1-1675946135012.png

 

Thank you for the help.

View solution in original post

Replies 5 (5)

Luke_K
Shopify Staff
402 66 102

Hey @joao_a_costa 

You might like to look into the publishablePublish mutation (docs) which will publish a resource to a channel. Worth noting that the write_publications scope required to run the mutation is currently available only to private apps installed on Shopify Plus stores. Hope that helps!

| Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
joao_a_costa
Shopify Partner
10 2 2

This is an accepted solution.

Thank you for your reply.

 

It is indeed the solution.

 

First, get the channels list:

joao_a_costa_0-1675946079737.png

 

Then call 'publishablePublish':

joao_a_costa_1-1675946135012.png

 

Thank you for the help.

Anthony_David_
Shopify Partner
417 46 106

@joao_a_costa did this really work for you? As when I run the first graphql it only returns the channelID but I no where see I publicationID in the response.

 

is this only for plus store?

 

@Luke_K 

Theme customization | Design | Shopify App Consultant
Have Any Questions? Whatsapp +1 (341) 241-4263
Based in United States
joao_a_costa
Shopify Partner
10 2 2

Hi Anthony,

Read the channel id in the result:

joao_a_costa_0-1695375288367.png

And set that id on the request on the graphql variables:

joao_a_costa_1-1695375353806.png

 

adaminnes
Visitor
1 0 0

The Channel ID is the same as the Publication id, just change the content type in the GID from "Channel" to "Publication" to use it in this mutation.

 

 

 

gid://shopify/Channel/1234567890

gid://shopify/Publication/1234567890