GenericVersionsMutationServerArgs
Defined in: packages/core/src/versions/api/types.ts:33
Base server-side args shared by every versions mutation function scoped
to a collection slug — currently just publish (unpublish to follow).
saveDraft no longer uses this base: it accepts EITHER a collection
({ collection, id }) or a global ({ global }) target, so its own args
type (versions/saveDraft.server.ts) is declared standalone. Mirrors
GenericGlobalsMutationServerArgs (api/globals/types.ts) but scoped to a
collection slug, with one deliberate difference: config is optional
here, matching GenericQueryServerParams’s convention (api/types.ts)
rather than GenericMutationServerParams’s required one. A caller that
omits it still fails safely: every operation below resolves collection
via args.config?.collections.find(...), so a missing config surfaces
through the exact same “no collection registered” ConvexError every
operation already throws for an unknown slug, rather than opening a second,
differently-worded failure mode.
Type Parameters
Section titled “Type Parameters”DataModel
Section titled “DataModel”DataModel extends GenericDataModel
The Convex data model (inferred from ctx).
TCollectionSlug
Section titled “TCollectionSlug”TCollectionSlug extends CollectionSlug = CollectionSlug
Collection slug.
Properties
Section titled “Properties”access?
Section titled “access?”
optionalaccess?:AccessCallOptions<MutationCallAction>
Defined in: packages/core/src/versions/api/types.ts:38
Per-call access overrides.
optionalauth?:VexApiAuth
Defined in: packages/core/src/versions/api/types.ts:44
Resolved caller identity for permission checks — { user, organization? },
or omitted when access control is off. Never a client argument; the
versionsApi factory (Step 9) resolves it from ctx.auth per request.
collection
Section titled “collection”collection:
TCollectionSlug
Defined in: packages/core/src/versions/api/types.ts:53
The versioned collection slug this call targets.
config?
Section titled “config?”
optionalconfig?:VexConfig
Defined in: packages/core/src/versions/api/types.ts:51
The resolved VexConfig. Optional at the type level — see this interface’s
docstring for why omitting it is never a silent no-op.
ctx:
GenericMutationCtx<DataModel>
Defined in: packages/core/src/versions/api/types.ts:46
Discriminator: server args MUST supply a Convex mutation context.
environmentId?
Section titled “environmentId?”
optionalenvironmentId?:string
Defined in: packages/core/src/versions/api/types.ts:58
Reserved for a future multi-environment spec (see this spec’s decision log). Accepted and ignored by every versions operation today.