NerdWalletOSS / apollo-cache-policies

An extension of the Apollo 3 cache with support for advanced cache policies.
Apache License 2.0
157 stars 21 forks source link

Apollo 3.8.0 no longer type compatible with apollo-cache-policies #69

Closed mstykow closed 1 year ago

mstykow commented 1 year ago

Apollo recently improved the typing of the cache.modify function by introducing generics. Since apollo-cache-policies mimics the cache interface which includes the modify function, the created cache is no longer type compatible as of Apollo 3.8.0.

Apollo PR: https://github.com/apollographql/apollo-client/pull/10895

In particular this commit: https://github.com/apollographql/apollo-client/commit/e187866fdfbbd1e1e30646f289367fb4b5afb3c3

Change required here (need to introduce generics): https://github.com/NerdWalletOSS/apollo-cache-policies/blob/ece8b039e35ba1e24f0e0e905efe0de3200ae55a/src/cache/InvalidationPolicyCache.ts#L141

Great library! Thank you!!

danReynolds commented 1 year ago

Thanks for letting us know! Updated it in the 2.10.0 release!