Sanity Library Reference Docs
    Preparing search index...

    Inputs to predicate evaluation: the delta-mode natives before()/after(), the mutation, the guard, and identity(). before is null on create, after null on delete.

    interface MutationContext {
        action: LakeMutationGuardAction;
        after: { _id: string; _type: string } & Record<string, unknown> | null;
        before: { _id: string; _type: string } & Record<string, unknown> | null;
        identity?: string;
    }
    Index

    Properties

    after: { _id: string; _type: string } & Record<string, unknown> | null
    before: { _id: string; _type: string } & Record<string, unknown> | null
    identity?: string

    The caller's principal id in the guarded resource's own namespace (what that lake's identity() returns), resolved as identity() in the predicate. Advisory — the engine takes the caller's word for who is acting; only the lake's own token identity is authenticated.