When creating a product using the ProductCreate graphQL mutation the product does not get added to the sales channels even though the product status is set to ACTIVE.
My understanding of the above text is that if the product status is active during creation of the product it should automatically be added to all channels.
Requiring an additional request to publish the product after-the-fact is counter-intuitive and increases network load, in addition to having a different result as with the rest API which does in fact publish the product to all channels when the status is active.
tldr; is for the GraphQL API, this is the intended functionality, you will have to make two mutations.
So when Product Status was released, it was intended that to decouple the status from the publishing of products to sales channels.
Decoupling publishing from status allows a lot more flexibility for merchants when they are creating their products.
You will also notice with the GraphQL API creating a product and publishing a product have two different scopes required.
I agree that the current description of the Active status is misleading, so you should see updated docs for that coming soon.
thanks for the reply and the explanation. I understand wanting to decouple and quite often it makes sense, but also there are times where itâs simply overcomplicating, which I believe is what your team are doing in this case. Requiring two http requests to perform an operation where only one is required for the rest api is a step backwards. The now deprecated options in the previous version of the mutation make more sense as well. Having the option create a product and publish it to all available channels at the same time. The way the .mutation is now requires also knowing th idâs of the channels you wish to publish the product. So if we havenât stored this previously what would would take a single http request using the rest api would take a minimum of 3 http requests with graphQL. Furthermore the now deprecated options are replaced with publishablepublish which apparently is only available for plus merchants or are we supposed to use productPublish..oh wait thats also only available for plus merchants.. so what mutation are we supposed to use then to publish the newly created product thatâs active but actually not?
So at the end of the day I can create a product, via graphql, but canât publish it to the available channels on the merchants shop? Or am I missing something, or has the dev team dropped the ball along the way trying to âdecoupleâ everything? I guess I will stick with the REST API until the growing pains with graphql are over. Granted it does make some operations easier but others like this are in my opinion just not really thought through.
Hello, I have a very similar problem. When I create and publish a product using ShopifySharp c#/.NET library, it gets only published to Online Store channel, but not the Buy Button channel.
Is there a way to do it in ShopifySharp (if anyoneâs aware of this) to publish to all channels, and/or is there an alternative in Rest API (I couldnât find anything similar to PublishablePublish in Rest API)? We donât use GraphQLâŚ
With the rest API? If so then the behavior has changed, but I donât see any indication of that in the change log. We have an app, early 2021, where we use the rest api to create a product, and it added it to all sales channels.
I just tested this and can confirm that it only now adds it to the online store, and there does not appear to be a way to publish the product to all sales channels via the product rest api!
@lizk can you please confirm that there is no way to add a product to a sales channel via the rest api?
So I tried this again. I thought that maybe I needed to provide some additional fields on the product data, so I tried it with data that looked like this:
{
"product": {
"body_html": "This is a test product.",
"title": "Test Product - Single",
"status": "active",
"published_scope": "global"
}
}
I hadnât provided the status and published_scope field before. Still, this made no difference. The product was only published to the âOnline Storeâ sale channel.
Regarding your note that âYou can publish to any sales channel with the PublishablePublish mutation.â However, the shopify.dev documentation says that this mutation ârequires write_publications access scope, but this scope is currently available only to private apps installed on Shopify Plus stores.â Does this mean that public apps cannot use this mutation to publish to channels? If not, how can we publish to channels on product update?
So over a year later and the answer is still to use deprecated fields? Seems like a bad idea to deprecate a feature when it is the only way to achieve something.