GraphQLGuide / apollo-datasource-mongodb

Apollo data source for MongoDB
MIT License
285 stars 64 forks source link

Deduplicate cache.set #9

Open lorensr opened 4 years ago

lorensr commented 4 years ago

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

bitops commented 3 years ago

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

lorensr commented 3 years ago

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