2 ms·
Deduplication shouldn’t work on mutations at all! There has got to be something else wrong. If I were to guess, it’s probably an issue with the Apollo React int
by true_religion 7y ago
Deduplication shouldn’t work on mutations at all! There has got to be something else wrong. If I were to guess, it’s probably an issue with the Apollo React interface.
Also IDs aren’t required for cache updates, only the typename.
- 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...