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

(graphcache) - Enable more cache.keyOfEntity parent cases and deprecate cache.resolveFieldByKey #1219

Merged
merged 5 commits into from
Dec 10, 2020

Conversation

kitten
Copy link
Member

@kitten kitten commented Dec 10, 2020

Resolve #1207
Follow up to #1208

Summary

This enables a case that the previous patch was meant to enable, the usage of cache.resolve(parent, ...) where parent does not have a __typename field (or other keyable field) set yet.

This also deprecated cache.resolveFieldByKey since I coincidentally noticed that it's not necessary anymore.

Set of changes

  • Move up ctx.parent check in cache.keyOfEntity
  • Refactor cache.keyOfEntity slightly
  • Deprecate cache.resolveFieldByKey in favour of cache.resolve and update docs
  • Replace cache.resolveFieldByKey in extras sources

@changeset-bot
Copy link

changeset-bot bot commented Dec 10, 2020

🦋 Changeset detected

Latest commit: d23dc0f

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

@kitten kitten changed the title Fix/enable more keyofentity cases (graphcache) - Enable more cache.keyOfEntity parent cases and deprecate cache.resolveFieldByKey Dec 10, 2020
@kitten kitten requested a review from JoviDeCroock December 10, 2020 15:17
@kitten kitten merged commit 4327263 into main Dec 10, 2020
@kitten kitten deleted the fix/enable-more-keyofentity-cases branch December 10, 2020 15:34
@github-actions github-actions bot mentioned this pull request Dec 10, 2020
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.

(graphcache) - cache.resolve(parent, ...) doesn't seem to work
2 participants