Skip to content

Commit 5379ac3

Browse files
authored
Merge pull request #176 from Netflix/fix/test
handle nullability due to breaking changes in DataLoader v4.0.0
2 parents e9340a6 + 1447bbd commit 5379ac3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/com/example/demo/datafetchers/ReviewsDataFetcher.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class ReviewsDataFetcher(private val reviewsService: ReviewsService) {
4646
val show : Show? = dfe.getSource()
4747

4848
//Load the reviews from the DataLoader. This call is async and will be batched by the DataLoader mechanism.
49-
return reviewsDataLoader.load(show?.id)
49+
return show?.id?.let { reviewsDataLoader.load(it) } ?: CompletableFuture.completedFuture(emptyList())
5050
}
5151

5252
@DgsMutation

0 commit comments

Comments
 (0)