apollo-datasource-mongodb icon indicating copy to clipboard operation
apollo-datasource-mongodb copied to clipboard

Deduplicate cache.set

Open lorensr opened this issue 5 years ago • 2 comments

Currently if a request triggers N findOneById(123) calls (all with the same id), and the cache is empty, there will be N calls to cache.set(123, doc). It would be nice if we could deduplicate that, like DataLoader memoizes .load

lorensr avatar Dec 18 '19 06:12 lorensr

@lorensr do you have any guidance on how this change could be implemented?

bitops avatar Aug 21 '21 22:08 bitops

Not sure, but happy to look at pseudocode or a PR

lorensr avatar Aug 21 '21 22:08 lorensr