From fb5bf3ecee14b541bc64eafa5bd1710ab25d557b Mon Sep 17 00:00:00 2001 From: Max Jacob Schridde Date: Tue, 1 Oct 2019 12:09:19 -0700 Subject: [PATCH] ensure params.filter present before accessing object keys --- packages/ra-data-graphql-simple/src/buildVariables.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ra-data-graphql-simple/src/buildVariables.js b/packages/ra-data-graphql-simple/src/buildVariables.js index 4f816056560..968e2ecd49b 100644 --- a/packages/ra-data-graphql-simple/src/buildVariables.js +++ b/packages/ra-data-graphql-simple/src/buildVariables.js @@ -100,7 +100,7 @@ const buildGetListVariables = introspectionResults => ( aorFetchType, params ) => { - const filter = Object.keys(params.filter).reduce((acc, key) => { + const filter = params.filter ? Object.keys(params.filter).reduce((acc, key) => { if (key === 'ids') { return { ...acc, ids: params.filter[key] }; } @@ -174,7 +174,7 @@ const buildGetListVariables = introspectionResults => ( } return { ...acc, [key]: params.filter[key] }; - }, {}); + }, {}) : {}; return { page: parseInt(params.pagination.page, 10) - 1,