How to perform a "publish" through the API/JavaScript client in

2 replies
Last updated: Jul 21, 2020
Is there a way to perform a “publish” through the API/JavaScript client? (We’d like to add a “publish all drafts” button)
Jul 21, 2020, 8:43 AM
One way to accomplish this would be using the
package to run a
operation using
useDocumentOperation(id, type)
Or you could probably just remove the
prefix from the
value to achieve the same 🙂
Jul 21, 2020, 9:58 AM
ah thanks peter, I’ll take a look
Jul 21, 2020, 10:29 AM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?