Handle missing objects in graphql

This commit is contained in:
Syer10
2023-04-02 20:39:56 -04:00
parent 52bda2c080
commit e8c2bad187
9 changed files with 50 additions and 27 deletions

View File

@@ -33,8 +33,8 @@ import java.util.concurrent.CompletableFuture
* - Delete download
*/
class ChapterQuery {
fun chapter(dataFetchingEnvironment: DataFetchingEnvironment, id: Int): CompletableFuture<ChapterType> {
return dataFetchingEnvironment.getValueFromDataLoader<Int, ChapterType>("ChapterDataLoader", id)
fun chapter(dataFetchingEnvironment: DataFetchingEnvironment, id: Int): CompletableFuture<ChapterType?> {
return dataFetchingEnvironment.getValueFromDataLoader("ChapterDataLoader", id)
}
enum class ChapterSort {