diff --git a/packages/keystone/src/admin-ui/system/getAdminMetaSchema.ts b/packages/keystone/src/admin-ui/system/getAdminMetaSchema.ts index ee912e630d6..6296f1064b6 100644 --- a/packages/keystone/src/admin-ui/system/getAdminMetaSchema.ts +++ b/packages/keystone/src/admin-ui/system/getAdminMetaSchema.ts @@ -56,6 +56,9 @@ export function getAdminMetaSchema({ 'KeystoneAdminUIFieldMeta.isOrderable cannot be resolved during the build process' ); } + if (!lists[rootVal.listKey].fields[rootVal.path].input?.orderBy) { + return false; + } const isOrderable = lists[rootVal.listKey].fields[rootVal.path].graphql.isEnabled.orderBy; if (typeof isOrderable === 'function') { return isOrderable({ @@ -76,6 +79,9 @@ export function getAdminMetaSchema({ 'KeystoneAdminUIFieldMeta.isOrderable cannot be resolved during the build process' ); } + if (!lists[rootVal.listKey].fields[rootVal.path].input?.where) { + return false; + } const isFilterable = lists[rootVal.listKey].fields[rootVal.path].graphql.isEnabled.filter; if (typeof isFilterable === 'function') { return isFilterable({