Sanity Library Reference Docs
    Preparing search index...

    Type Alias PublishAction

    Publishes a draft document. If a published version of the document already exists this is replaced by the current draft document. In either case the draft document is deleted. The optional revision id parameters can be used for optimistic locking to ensure that the draft and/or published versions of the document have not been changed by another client.

    type PublishAction = {
        actionType: "sanity.action.document.publish";
        draftId: string;
        ifDraftRevisionId?: string;
        ifPublishedRevisionId?: string;
        publishedId: string;
    }
    Index

    Properties

    actionType: "sanity.action.document.publish"
    draftId: string

    Draft document ID to publish

    ifDraftRevisionId?: string

    Draft revision ID to match

    ifPublishedRevisionId?: string

    Published revision ID to match

    publishedId: string

    Published document ID to replace