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

(core) - Fix (cloned) mutation operation being compared rather than a stable identity #2228

Merged
merged 4 commits into from
Jan 31, 2022

Conversation

kitten
Copy link
Member

@kitten kitten commented Jan 31, 2022

Resolve #2225

Summary

This addresses a regression from #2189 where a mutation's operation is compared to filter results.
Such a comparison will always fail in the presence of cache exchanges that create new operations to update
the document of the operation (or variables)

Instead, we can introduce a stand-in identity object for the mutation instead and use that to compare.
This isn't a final resolution of the issue but a quick workaround.

Set of changes

  • Add OperationContext._identity to compare mutation identities

Instead of comparing the mutation operation's identity, we need
a stand-in object, whose identity can remain stable, even as
query document and other parameters are cloned and copied.
@kitten kitten requested a review from JoviDeCroock January 31, 2022 12:51
@changeset-bot
Copy link

changeset-bot bot commented Jan 31, 2022

🦋 Changeset detected

Latest commit: 45ada80

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@urql/core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kitten kitten changed the title Fix/original instance loss (core) - Fix (cloned) mutation operation being compared rather than a stable identity Jan 31, 2022
@kitten kitten merged commit 8892ea8 into main Jan 31, 2022
@kitten kitten deleted the fix/original-instance-loss branch January 31, 2022 12:57
@urql-ci urql-ci mentioned this pull request Jan 31, 2022
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.

(core) - Fix mutation operation's identity being used for filtering results
2 participants