Focusing on managing products, variants, and collections through the API.
Hi there,
I am having trouble to publish/unpublish product via GraphQL. Per this doc:
https://help.shopify.com/en/api/graphql-admin-api/reference/mutation/productupdate
published (Boolean) This argument is deprecated: Use PublishablePublish instead.
is deprecated.
However, if I follow this doc: https://help.shopify.com/en/api/graphql-admin-api/reference/mutation/publishablepublish
1. I do not see this scope available - https://help.shopify.com/en/api/getting-started/authentication/oauth/scopes
write_publications access scope
2. Also, PublicationInput seems to need a channelID. It seems it is another pain.
Am I following right? Or there is some other way to do via GraphQL API? Otherwise, I am ok on REST just want to understand. Thank you so much!
Did you find a solution? Many people have this issue
I can't publish a product or collection to "Online store" channel, which is pretty trivial use-case. They just created as "unavailable".
Went via REST.
Still not possible using GraphQL Admin API?
@evladimir wrote:Did you find a solution? Many people have this issue
I can't publish a product or collection to "Online store" channel, which is pretty trivial use-case. They just created as "unavailable".
Seems the simplest way is:
productCreate(input: { title: "Green Tea Ginger Twist", productType: "test", published: true, } )
There's so much ambiguous crap and deception about what is actually functional in the docs that I've spent about an hour and half sorting this out.
The problem with "published: true" is that it only publishes for "online store" which is usually not the only intent
@azacs wrote:
@evladimir wrote:Did you find a solution? Many people have this issue
I can't publish a product or collection to "Online store" channel, which is pretty trivial use-case. They just created as "unavailable".
Seems the simplest way is:
productCreate(input: { title: "Green Tea Ginger Twist", productType: "test", published: true, } )There's so much ambiguous crap and deception about what is actually functional in the docs that I've spent about an hour and half sorting this out.
But the "published" field is marked as deprecated in latest api version 2020-04
Looking through the forum it seems it's been depreciated for years.
It's a tragedy, but there's no other option with open graph.
"published" is marked as deprecated on GraphQL API but not on Rest Admin API (Search 'Create a new unpublished product').
That's a shame that's there are no any comments and suggestions from Shopify on a preferred approach.
So one of the methods is deprecated, the other one is only available for private apps on Plus stores, and the last one is to use REST instead of promoted GraphQL. So if you built an app that uses GraphQL all over, but now to publish a product you would also need to incorporate a REST call...
No words...
publishablePublish mutation works now, write_publications & read_publications scopes has been added
query publications {
publications(first: 5) { # getting a limited amount of items is risky
edges {
node {
id
name # deprecated
}
}
}
}
But:
query publications {
publications(first: 5) {
edges {
node {
id
catalog { # this is null
name
}
}
}
}
}
You can adjust the number from 5 to a larger one. But I also got the same catalog as null. Not sure why Shopify makes it so complicated.
I want my product published on the online store only. But the rest admin API is not reliable. I try to set the published_scope to 'web' and call the productUpdate mutation but it's not working. It gives an error message - Channel Channel XXXX does not support bundle products