From ec133e8ea2a7ea1efef6fb4448fd7f03da40650c Mon Sep 17 00:00:00 2001 From: keyan Date: Tue, 25 Oct 2022 17:30:54 -0500 Subject: [PATCH] handle empty search query --- api/resolvers/search.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/resolvers/search.js b/api/resolvers/search.js index 5b7b3569..8dafc8e0 100644 --- a/api/resolvers/search.js +++ b/api/resolvers/search.js @@ -7,6 +7,13 @@ export default { const decodedCursor = decodeCursor(cursor) let sitems + if (!query) { + return { + items: [], + cursor: null + } + } + const whatArr = [] switch (what) { case 'posts':