From 769a7a4e54ee6fce1bc4dd3d6ab97453fde48c7a Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Sun, 12 Apr 2020 13:26:19 +1100 Subject: [PATCH] Expanded `_ksListsMeta` query input to take a key list --- .changeset/silver-monkeys-shop.md | 5 +++++ packages/keystone/lib/providers/listCRUD.js | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/silver-monkeys-shop.md diff --git a/.changeset/silver-monkeys-shop.md b/.changeset/silver-monkeys-shop.md new file mode 100644 index 00000000000..58d7e0082c3 --- /dev/null +++ b/.changeset/silver-monkeys-shop.md @@ -0,0 +1,5 @@ +--- +'@keystonejs/keystone': patch +--- + +Expanded `_ksListsMeta` query input to take a key list. diff --git a/packages/keystone/lib/providers/listCRUD.js b/packages/keystone/lib/providers/listCRUD.js index 1cf1ffdd857..7882f367325 100644 --- a/packages/keystone/lib/providers/listCRUD.js +++ b/packages/keystone/lib/providers/listCRUD.js @@ -91,7 +91,7 @@ class ListCRUDProvider { count: Int }`, `input ${this.gqlNames.listsMetaInput} { - key: String + key: [String] }`, `input _ListSchemaFieldsInput { type: String @@ -193,7 +193,7 @@ class ListCRUDProvider { // And the Keystone meta queries must always be available [this.gqlNames.listsMeta]: (_, { where: { key } = {} }, context) => this.lists - .filter(list => list.access[schemaName].read && (!key || list.key === key)) + .filter(list => list.access[schemaName].read && (!key || key.includes(list.key))) .map(list => list.listMeta(context)), }; }