Skip to content

isSortFieldValid

isSortFieldValid(props): boolean

Defined in: packages/core/src/collections/listView/listViewQueryState.ts:101

Whether field leads a declared index (or is "_creationTime", always sortable) — the same rule validateSavedListViewConfig enforces at config-definition time for a CODE-declared view’s own sort.field. A SHARED/LOCAL view’s sort.field is never checked at definition time (it’s user data, not code), so it can go stale after the field is removed or its index dropped — this re-checks it at resolve time instead.

Exported (polish fix, Decision 7) so @vexcms/react’s resolveEffectiveViewState can apply the IDENTICAL check — not just an equivalent one — to the “Modified” diff/“Save as new”/“Save in place” state it builds client-side, so the two never drift on what counts as stale.

CollectionConfig

string | undefined

boolean

true when field is undefined, "_creationTime", or leads one of collection’s declared indexes; false otherwise.