Skip to content

Commit

Permalink
Merge pull request #5999 from Kilometers42/hotfix/guard-against-missi…
Browse files Browse the repository at this point in the history
…ng-filter

Graphql data simple data provider: handle if type can't be found
  • Loading branch information
djhi committed Mar 5, 2021
2 parents fa787c6 + 0861691 commit 6d12c26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ra-data-graphql-simple/src/buildVariables.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const buildGetListVariables = introspectionResults => (
const type = introspectionResults.types.find(
t => t.name === `${resource.type.name}Filter`
);
const filterSome = type.inputFields.find(
const filterSome = type?.inputFields?.find(
t => t.name === `${key}_some`
);

Expand All @@ -144,7 +144,7 @@ const buildGetListVariables = introspectionResults => (
const type = introspectionResults.types.find(
t => t.name === `${resource.type.name}Filter`
);
const filterSome = type.inputFields.find(
const filterSome = type?.inputFields?.find(
t => t.name === `${parts[0]}_some`
);

Expand Down

0 comments on commit 6d12c26

Please sign in to comment.