Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
simplecommerce opened this issue Jun 21, 2021 · 1 comment
Closed

Comments

@simplecommerce
Copy link

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
Copy link
Member

lorensr commented Jun 21, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants