Sanity Library Reference Docs
    Preparing search index...

    Interface EditVariantActionBeta

    Modifies a variant version of a document by applying a patch.

    If no such variant document exists it is first created, by copying the variant's published sibling, or the published document if the variant was never published.

    interface EditVariantAction {
        actionType: "sanity.action.document.variant.edit";
        bundleId?: "drafts" | string & {};
        patch: PatchOperations;
        publishedId: string;
        variantId: string;
    }
    Index

    Properties

    actionType: "sanity.action.document.variant.edit"
    bundleId?: "drafts" | string & {}

    Source bundle: 'drafts', or a release id.

    Defaults to the published bundle.

    patch: PatchOperations

    Patch operations to apply.

    publishedId: string

    ID of the document group the variant belongs to. Must be a published document ID, without a drafts. or versions. prefix.

    variantId: string

    Name of the variant definition this document belongs to, as in _.variants.{variantName}. Must be a bare name, not a full document ID.