Skip to content

FieldPermissionKey

FieldPermissionKey<TData> = [Extract<keyof TData, string>] extends [never] ? string : Exclude<Extract<keyof TData, string>, SystemFieldKey>

Defined in: packages/core/src/access/types.ts:69

The gateable field names of a document type — its own keys minus the system keys Convex owns.

Degrades to string when the document type enumerates no keys — the pre-generation case, where AccessDocFor resolves to the wide fallback and DeclaredDoc strips its index signature down to {}. Without the degradation keyof would be never and EVERY map key would read as excess, so the validator would reject every map until vex generate has run. Degrading instead collapses both FieldPermissionMap branches to “any string-keyed map” and makes the exhaustiveness requirement inert, which is the same posture AccessDocFor already takes.

TData

Document type for the subject.