Skip to content

VexMutationOperation

VexMutationOperation = "create" | "remove" | "update" | "upsert" | "publish" | "unpublish"

Defined in: packages/core/src/revalidate/types.ts:27

Which vexConvexApi mutation produced a write, as it travels on the wire.

These are API method names, not CRUD actions — that is the whole reason this type exists separately from CrudWriteAction. vexConvexApi exposes remove and globals.upsert, so a client reports "remove" and "upsert"; the route maps them to the CRUD vocabulary ("delete", "update") exactly once, before either the permission check or target resolution. "publish" is named for the draft-workflow action, not the Convex function that performs it (vexConvexApi.versions.publish, for either a collection or a global) — the wire verb tracks what happened to the PUBLIC document, which is the only thing hasPermission/resolveTargets need to know. It maps to the same "update" CRUD action "upsert" already does (toCrudAction, createVexRevalidateRoute.ts): a publish purges exactly like an update — both a before and an after path may exist.

Declared here rather than in @vexcms/react because it is part of the wire contract that @vexcms/react (the client) and @vexcms/next (the route) must agree on, and @vexcms/core is the lowest package both depend on (P-010).