Publish products via GraphQL Admin API

samwise
Shopify Partner
31 0 3

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!

 

 

evladimir
Shopify Partner
2 0 3

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".

 

samwise
Shopify Partner
31 0 3

Went via REST.

0 Likes
Yu727
Excursionist
38 0 5

Still not possible using GraphQL Admin API?

azacs
Shopify Partner
9 0 9

@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.

 

seandkendall
Tourist
8 0 4

The problem with "published: true" is that it only publishes for "online store" which is usually not the only intent

0 Likes
tehcon
Tourist
3 0 1

@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 

0 Likes
azacs
Shopify Partner
9 0 9

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.

0 Likes

@tehcon 

"published" is marked as deprecated on GraphQL API but not on Rest Admin API (Search 'Create a new unpublished product')

SPO - SEO App to research keywords & edit social link preview
0 Likes