Reasons of 'Cache data may be lost when replacing ...' warning?

Hi everyone.

cache data may be lost when replacing the albums field of a Product object.
To address this problem (which is not a bug in Apollo Client), define a custom merge function for the Product.albums field, so InMemoryCache can safely merge these objects

I’ve encounter this warning while working on a mutation that gets an array back.

my situation is, sending mutation to add/remove active item to/from a list.
For response will get the effective list of active items.

I have searched for this warning, and i saw that it may be something about not querying the id field, which is not my case.
So I have been wondering why this warning is showed.
Because it does not affect anything, the warning shows up once, and no more.

I’ve read that, by default, the cache field’s existing array is completely replaced by the incoming array,
and this is exactly the behavior i want.
I know I can write a typePolicies to solve this problem, but I wonder if it’s necessary? for it’s default already being what i want.

is this warning just a friendly note? or do this affect some part i’ve failed to notice?
It seemed strange for apollo server to simply give out friendly note, but I just couldn’t find out the reason.

It is more just a friendly note to make extra sure you’re implementing pagination correctly. In this case since it’s already doing exactly what you want, it is totally safe to ignore the warning. Warnings get silenced when you build for production so it’s just noisy while developing. In my opinion it is a little too noisy, but it doesn’t hurt anything.