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

feat: add mutation plugin #46

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

quiteeasy
Copy link
Contributor

Close #15

This pull request introduces the initial implementation of the mutation plugin.

I noticed a couple of TODOs in the code (specifically in the useMutation hook, stating "TODO: move to plugin"). However, I am uncertain about moving the method responsible for invalidating cache entries to the plugin.

Relocating this functionality to the plugin would require passing mutation-scoped variables like vars and newData. This could potentially introduce coupling and complexity, as these variables are specific to individual mutations. Additionally, I'm uncertain about the tangible benefits of this approach.

Discarding cache entries within each respective mutation implementation might be more cohesive and aligned with the principle of separation of concerns.

I would appreciate your thoughts and feedback on this matter. Please share your perspective on the trade-offs and potential implications of moving the cache invalidation logic to the plugin versus keeping it within the mutation implementations.

Copy link

netlify bot commented May 20, 2024

Deploy Preview for funny-banoffee-0afb46 canceled.

Name Link
🔨 Latest commit 83c37a2
🔍 Latest deploy log https://app.netlify.com/sites/funny-banoffee-0afb46/deploys/664b2788af92290008c374b5

@posva
Copy link
Owner

posva commented May 23, 2024

Thanks! The todo was referring to another kind of plugin, something not yet in the codebase. Some todos are not explicit enough 😅
I appreciate the effort thought ! I will try to rework the PR to give you a review

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

Successfully merging this pull request may close these issues.

MutationPlugin
2 participants