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

@@ -28,9 +28,10 @@ class SourceDataLoader : KotlinDataLoader<Long, SourceType?> {
future {
transaction {
addLogger(Slf4jSqlDebugLogger)
SourceTable.select { SourceTable.id inList ids }.map {
SourceType(it)
}
val source = SourceTable.select { SourceTable.id inList ids }
.mapNotNull { SourceType(it) }
.associateBy { it.id }
ids.map { source[it] }
}
}
}