graph-gophers / dataloader

Implementation of Facebook's DataLoader in Golang
MIT License
1.21k stars 75 forks source link

Duplicate key for batchFun when applying no cache #68

Closed KingWu closed 2 years ago

KingWu commented 4 years ago

When applying no cache policy, i found that duplicate keys passed to batchFuc. After i query the keys from database and return the results, then will throw error which tell you the size of result and keys is not matched.

nicksrandall commented 3 years ago

No cache policy does no caching (and therefore no deduping). I think you'll have to handle the duplicate keys yourself if you intend to use that policy.

Generally speaking, the no-cache policy is intended for use-cases where there never would be any duplicates.