CollectionSlug
CollectionSlug =
GeneratedVexTypesextendsobject?S:string
Defined in: packages/core/src/types/generated.ts:60
Union of all collection slugs registered in this project’s VexCMS config.
- Before
vex generate: resolves tostring— any string is accepted. - After
vex generate: resolves to a specific union, e.g."posts" | "authors".
Used by RelationshipFieldInput.collection so that invalid slugs are caught
at compile time without the user passing explicit generic parameters.
Example
Section titled “Example”// After generation — type is "posts" | "authors" | "tags"import type { CollectionSlug } from "@vexcms/core"
relationship({ collection: "nonexistent" }) // ✗ Type error after generationrelationship({ collection: "posts" }) // ✓- GeneratedVexTypes for the augmentation interface
- RelationshipFieldInput for the primary consumer of this type