GraphQLGuide / apollo-datasource-mongodb

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

[QUESTION]: deleteFromCacheById doesn't work for findByFields #68

Closed simplecommerce closed 3 years ago

simplecommerce commented 3 years ago

Hi,

I haven't used it yet, but I noticed that deleteFromCacheById only works when used with findOneById. In the code, it doesn't seem to work for findByFields.

Can you confirm?

lorensr commented 3 years ago

Confirmed. This is the key if you'd like to delete the cached results of findByFields:

https://github.com/GraphQLGuide/apollo-datasource-mongodb/blob/master/src/cache.js#L131

I'd also be happy to receive a PR for deleteFromCacheByFields.