Skip to content

Commit

Permalink
Fix bug in DB API with null values (keystonejs#6500)
Browse files Browse the repository at this point in the history
  • Loading branch information
timleslie authored and Nikitoring committed Sep 14, 2021
1 parent 6231e87 commit 85677fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/popular-goats-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-next/keystone': patch
---

Fixed a bug in `context.db.lists` API when finding items that don't exist.
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ function getRootValGivenOutputType(originalType: OutputType, value: any): any {
if (originalType instanceof GraphQLNonNull) {
return getRootValGivenOutputType(originalType.ofType, value);
}
if (value === null) return null;
if (originalType instanceof GraphQLList) {
if (value === null) return null;
return value.map((x: any) => getRootValGivenOutputType(originalType.ofType, x));
}
return value[rawField];
Expand Down

0 comments on commit 85677fe

Please sign in to comment.