Hello, I have started using apollo and over the last few weeks, I ran into an issue that I really cannot seem to figure out and that is on the apollo basics page, I made it to the merge cached results and basically did the same thing as the example. I have everything working however my example shows the new results from fetch more, but it does not leave the old results. So there are two book cards, Book 1 and Book 2, and when I run fetch more, only Book 3 and Book 4 are displayed. I am really struggling to figure out why I can’t get all the results to stay. I followed this example here:
@dbzx10299 merge
functions will overwrite whatever is in the cache for the field they’re running against, which means if you’re seeing previously cached data being removed that you weren’t expecting to be removed, the merge
function return value isn’t quite what it should be. Have you tried console.log
/ adding a breakpoint just before the merge
function returns, to make sure what’s being returned really has concatenated the old values with the new values?