urql-graphql / urql

The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
https://urql.dev/goto/docs
MIT License
8.54k stars 444 forks source link

fix(graphcache): entity invalidation through string key #3544

Closed JoviDeCroock closed 3 months ago

JoviDeCroock commented 3 months ago

Resolves #3543

Summary

When using a string-key like Todo:1 it won't invalidate the entity, it will however try to invalidate the type which is also not present. This addresses that by checking whether it's an entity by checking whether Todo:1.__typename is part of the cache.

changeset-bot[bot] commented 3 months ago

🦋 Changeset detected

Latest commit: 67a09043f8a796742f63cbd74667f3b824dbe938

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