Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
andnewData
. 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.