Skip to content

Commit

Permalink
Merge pull request #4828 from stensrud/fix-graphql-simple-null-values
Browse files Browse the repository at this point in the history
Avoid treating null-values as objects with keys
  • Loading branch information
djhi authored May 19, 2020
2 parents 0e81f4f + 7adb91f commit 8b04ff8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ra-data-graphql-simple/src/getResponseParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const sanitizeResource = data => {
}

if (Array.isArray(dataKey)) {
if (typeof dataKey[0] === 'object') {
if (typeof dataKey[0] === 'object' && dataKey[0] !== null) {
return {
...acc,
[key]: dataKey.map(sanitizeResource),
Expand All @@ -24,7 +24,7 @@ const sanitizeResource = data => {
}
}

if (typeof dataKey === 'object') {
if (typeof dataKey === 'object' && dataKey !== null) {
return {
...acc,
...(dataKey &&
Expand Down

0 comments on commit 8b04ff8

Please sign in to comment.