Is there a simpel way to publish product to all publications via GraphQL API?

Louise_Elmose_H
Shopify Partner
78 2 21

Hi,


As far as I can see, it requires several calls to publish or unpublish a product, i.e. 1 + [number of publications] calls, so 4 calls if you have 3 publications, one call for getting the publication ids, and then one call for each publication you want to publish product on.

Is there a more simpel way, e.g. as the deprecated "published" parameter on the product? It would be nice with a publish-on-all-publications mutation.

 

Thanks,

-Louise

Replies 2 (2)

Louise_Elmose_H
Shopify Partner
78 2 21

Ah sorry, I misread the API documentation, you can publish on a list of publication ids, so 2 calls is required

jam_chan
Shopify Partner
892 23 171

What is the simple way? The productPublications and publications fields are deprecated in 2023-07 API version. Only publishableUnpublish mutation can be used. I don't see any simple way do so?

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview