Skip to content

Commit

Permalink
Fix unorderable fields looking orderable in the Admin UI (#6619)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown authored Sep 21, 2021
1 parent 581e130 commit 7a7f3f6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/keystone/src/admin-ui/system/getAdminMetaSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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({
Expand Down

0 comments on commit 7a7f3f6

Please sign in to comment.