One of the users of our private app on our Shopify Plus store is asking if we’d be able to automatically flag products as published on all of our available channels.
From some browsing of the API documentation it looks like the autoPublish flag on the Publication object might be what I want to use. At the moment all of our publications have it set to false.
I have tried to update it on one of the publications using the publicationUpdate mutation and it appears to have worked (it doesn’t return an error and returns a version of the Publication with the flag set to true) but if I then requery the publication it’s still set to false.
My private app has the read/write publication permission.
Here is the query:
mutation publicationUpdate(
\$id: ID!,
\$input: PublicationUpdateInput!
) {
publicationUpdate(id: \$id, input: \$input) {
publication {
id
name
autoPublish
}
userErrors {
field
message
}
}
}
And the variable:
{
"id": "gid://shopify/Publication/xxxxxxxxxxxxx",
"input": {
"autoPublish": true
}
}
And the return from the api is:
{"data":{"publicationUpdate":{"publication":{"id":"gid://shopify/Publication/xxxxxxxxxxxxx","name":"Google & YouTube","autoPublish":true},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":1000.0,"currentlyAvailable":990,"restoreRate":50.0}}}}
Any idea if I am doing something wrong or if there’s a bug somewhere?
Thanks in advance for any help!
Angus