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): consistent __typename removal #2718

Closed
wants to merge 8 commits into from

Conversation

JoviDeCroock
Copy link
Collaborator

@JoviDeCroock JoviDeCroock commented Oct 7, 2022

Summary

While investigating #2701 I noticed that we invalidate the result for a cache-hit due to not having __typename there, on a closer look this is because when we foward we add the __typename in formatDocument, this is also returned to the user because we have changed the operation itself, but when we get a result from cache we use the supplied query which might be missing these __typename additions.

To counter-act this we will always query the result with the original query in mind

Set of changes

  • preserve the original query

@JoviDeCroock JoviDeCroock requested a review from kitten October 7, 2022 09:32
@changeset-bot
Copy link

changeset-bot bot commented Oct 7, 2022

🦋 Changeset detected

Latest commit: c7eca9f

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

This PR includes changesets to release 1 package
Name Type
@urql/exchange-graphcache 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

@JoviDeCroock JoviDeCroock force-pushed the ensure-typename-consistency branch from b947f5e to 68fbc42 Compare October 7, 2022 11:33
@JoviDeCroock JoviDeCroock changed the title fix(graphcache): consistent __typename addition fix(graphcache): consistent __typename removal Oct 9, 2022
@JoviDeCroock
Copy link
Collaborator Author

Superseded by da121d4

@kitten
Copy link
Member

kitten commented Oct 13, 2022

Testing a different approach this in #2736, which instead tries to preserve the original document and continue to prevent adding __typename when it's not in the original document (which was, I believe, an issue reported in the past)

@JoviDeCroock
Copy link
Collaborator Author

@kitten did you mean to post this in #2731?

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