77 ms·
> Also IDs aren’t required for cache updates, only the typename. this is very inacurate. The problem happens when an items is cached with an ID and then anothe
by Capaj 7y ago
> Also IDs aren’t required for cache updates, only the typename.
this is very inacurate. The problem happens when an items is cached with an ID and then another GraphQL request tries to cache it without and ID or vice versa. This is where the apollo-cache-inmemory blows up with an error like this: https://api.media.atlassian.com/file/f82c0ee8-2412-4f1b-8027-82c95a36d34e/binary?token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiIzMWU1NWNiYy1jNzFhLTQxYWQtYjIxNC1jYWUyNDdiMDE4ZDUiLCJhY2Nlc3MiOnsidXJuOmZpbGVzdG9yZTpmaWxlOjM2N2VhZjBjLTc5ZTItNDU1My04YWI4LTBhYmVkNWU3MmIwOCI6WyJyZWFkIl0sInVybjpmaWxlc3RvcmU6ZmlsZTowMmM1NGMzYy1jZTcxLTQ4NTgtOTFmZS1mYThhMWQ3MzZlYzQiOlsicmVhZCJdLCJ1cm46ZmlsZXN0b3JlOmZpbGU6ZjgyYzBlZTgtMjQxMi00ZjFiLTgwMjctODJjOTVhMzZkMzRlIjpbInJlYWQiXX0sImV4cCI6MTU1OTMzNjE5NywibmJmIjoxNTU5MzM1MjM3fQ.6CqucKUKHm3qGl28whMVe61MU48mboxfHeSrvhFnOtU&client=31e55cbc-c71a-41ad-b214-cae247b018d5 https://api.media.atlassian.com/file/f82c0ee8-2412-4f1b-8027...
There's even a test for this unfortunate behavior: https://github.com/apollographql/apollo-client/blob/master/packages/apollo-cache-inmemory/src/__tests__/__snapshots__/writeToStore.ts.snap https://github.com/apollographql/apollo-client/blob/master/p...