Skip to content
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

DataLoader with a DefaultCache throws key error when attempting to delete key that does not exist #2464

Open
vjrasane opened this issue Jan 17, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@vjrasane
Copy link

vjrasane commented Jan 17, 2023

Caused by:

    def delete(self, key: K) -> None:
        del self.cache_map[self.cache_key_fn(key)]

https://github.com/strawberry-graphql/strawberry/blame/8498682d0c192e5b940f93928fef0f230918c8c7/strawberry/dataloader.py#L83

In strawberry-graphql version 0.154.0

This can be worked around by providing a custom cache to the dataloader that checks existence before removal.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@vjrasane vjrasane added the bug Something isn't working label Jan 17, 2023
@vjrasane vjrasane changed the title DataLoader with a DefaultCache throws key error when attempting to remove key that does not exist DataLoader with a DefaultCache throws key error when attempting to delete key that does not exist Jan 17, 2023
dartt0n added a commit to dartt0n/strawberry that referenced this issue Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant