I was reading the InMemoryCache
documentation about the TypePolicy
options, and I see it is missing the merge
property. Should this be added to the docs, or is it hidden by design? I’d create a PR, but I have no idea how to describe it.
As an aside, I used it to get rid of the warning about not being able to merge some types. In my case, these are child objects without their own identity. I found a StackOverflow answer saying to set merge
to true
which solved the problem. However, now that I’ve read the docs more fully, I see the actual solution is to pass false
for keyFields
so these objects get embedded in their parent. But merge
is clearly used by the cache, so I feel it should be documented.
cache: new InMemoryCache({
typePolicies: {
Address: {
merge: true, <-- document this?
// keyFields: false, <-- better in my case
},
},
})