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

fix(graphcache): fix restoring variables on mutation operations #3046

Merged
merged 5 commits into from
Mar 14, 2023

Conversation

JoviDeCroock
Copy link
Collaborator

@JoviDeCroock JoviDeCroock commented Mar 14, 2023

Summary

Before we send out the mutation we filter the variables so extraneous variables don't cause an issue on the server. However this makes it so that we don't restore them afterwards as they are not part of the operations Map. This gives us a way to restore variables on mutations.

Works now: https://codesandbox.io/s/empty-water-6tm6yy?file=/src/index.js

@JoviDeCroock JoviDeCroock requested a review from kitten March 14, 2023 19:03
Copy link
Member

@kitten kitten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good 👍 I think we can think of alternatives in the future. Generally, I'm not opposed to maybe creating an original property poibnting at what makeOperation's second argument was.
This could potentially then also be used for other cases.

@JoviDeCroock JoviDeCroock merged commit d41fac8 into main Mar 14, 2023
@JoviDeCroock JoviDeCroock deleted the restore-variables-on-mutations branch March 14, 2023 20:12
@github-actions github-actions bot mentioned this pull request Mar 15, 2023
@github-actions github-actions bot mentioned this pull request Mar 27, 2023
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

Successfully merging this pull request may close these issues.

2 participants