Sanity Library Reference Docs
    Preparing search index...
    ValueExpr:
        | { type: "literal"; value: unknown }
        | {
            field: string;
            path?: string;
            scope?: "workflow" | "stage";
            type: "fieldRead";
        }
        | { param: string; type: "param" }
        | { type: "actor" }
        | { type: "now" }
        | { type: "self" }
        | { type: "stage" }
        | {
            fields: Record<
                string,
                | { type: "literal"; value: unknown }
                | {
                    field: string;
                    path?: string;
                    scope?: "workflow" | "stage";
                    type: "fieldRead";
                }
                | { param: string; type: "param" }
                | { type: "actor" }
                | { type: "now" }
                | { type: "self" }
                | { type: "stage" }
                | ({ type: "object"; fields: Record<string, ValueExprInternal>; }),
            >;
            type: "object";
        }

    An operation's write value, resolved when the operation applies. param reads a caller-supplied action argument; actor records the acting identity. now supplies the operation's ISO timestamp, self its instance's GDR URI, and stage the current stage name. object resolves its fields recursively.

    A fieldRead with no scope searches activity, stage, then workflow fields. An explicit scope searches only that scope. A pathless read from a subject or doc.ref into another subject or doc.ref preserves the stored reference. Other reads use the referenced snapshot document, or only its _id and _type when it is not loaded. No additional documents are fetched. Initialization uses FieldSource, whose field-read scope rules differ.