What is the order of Mutations I need to make in order to Create and Publish a Collection via GraphQL?
I have tried the following:
collectionCreate mutation
collectionPublish mutation
However for step 2 it requires a Publication ID.
Why can’t we just publish within the collectionCreate mutation?
Do I need to find the Publication IDs first (query them) then run collectionPublish mutation?
Seems kind of redundant when I have added multiple Collections and just want them published.
From digging into this, it does seem you’ll need to make a query to get the publicationId if you don’t have this already, so the process would be:
- Use
collectionCreate to create the collection.
- Query for
publicationId if unknown.
- Use
publishablePublish to publish the collection.
Thanks @Liam-Shopify,
Is there much of a difference using publishablePublish as opposed to the collectionPublish mutation to ensure publication of a Collection?
collectionPublish is specifically designed for collections and is used to publish them to a publication. It might be simpler to use if your focus is solely on collections.