Closed BickelLukas closed 3 months ago
The documentation says that for the "entity" parameter it can be a GraphQL object or an entity key:
but calling cache.invalidate("123") does not work as expected.
cache.invalidate("123")
The problem is the shouldInvalidateType check when trying to invalidate just a single entity without fields or args https://github.com/urql-graphql/urql/blob/431b64b4086d3d1dafb2af4881a95fa642134daf/exchanges/graphcache/src/store/store.ts#L167-L171
shouldInvalidateType
because of this it is now trying to invalidate the type "123" instead of the entity with id "123"
In Description
urql: 4.0.6 @urql/exchange-graphcache: 6.5.0
This is fixed and released with #3544
Works perfectly now. Thanks for the amazingly quick fix and release! 🎉
Describe the bug
The documentation says that for the "entity" parameter it can be a GraphQL object or an entity key:
but calling
cache.invalidate("123")
does not work as expected.The problem is the
shouldInvalidateType
check when trying to invalidate just a single entity without fields or args https://github.com/urql-graphql/urql/blob/431b64b4086d3d1dafb2af4881a95fa642134daf/exchanges/graphcache/src/store/store.ts#L167-L171because of this it is now trying to invalidate the type "123" instead of the entity with id "123"
Reproduction
In Description
Urql version
urql: 4.0.6 @urql/exchange-graphcache: 6.5.0
Validations