# graphql-kotlin


11/30/2021, 3:35 PM
Hello experts. The graphql-kotlin project looks great to me, but one tiny point in the ktor example was unclear. In the dataloaders, the entities are searched for based on a set of ids
, and the resulting list is then filtered for only those that match that same set of ids
allBooks.filter { idSet.contains( }
. Is that filter not superfluous? Thanks, Eamonn[…]aphql/examples/server/ktor/schema/dataloaders/BookDataLoader.kt

Shane Myrick

11/30/2021, 8:22 PM
You are correct that all the ids have been filtered, but the DataLoader is actually a
for the ids mapped to a
so that is why we have the double filter there to group the ids by all books so we only have to call
once I suppose what we could actually do is map every id to call the
function instead, but this is just a basic example
👍 1