Consider a schema:
chat {
id
lastMessage {
id
content
}
allMessages {
id
content
}
}
Where lastMessage should be exhibited on an "Chat list" and allMessages on the open chat.
If I try to call refetch(() => chat.lastMessage.content) not only the last message cache will be mutated, but also the message on allMessages that previously was the lastMessage.
That is because (I think) there is no means to configure how should a new data be interpreted as new object or modification of an old object. But I guess the configured identifier could be used to handle this, right? If new object, don't mutate but create new object in place...
I don't have a reproduction right now, but tell me if you want me to build some for it or is it already handled somehow and the error is on my part.
Thanks
Consider a schema:
Where
lastMessageshould be exhibited on an "Chat list" andallMessageson the open chat.If I try to call
refetch(() => chat.lastMessage.content)not only the last message cache will be mutated, but also the message onallMessagesthat previously was thelastMessage.That is because (I think) there is no means to configure how should a new data be interpreted as new object or modification of an old object. But I guess the configured
identifiercould be used to handle this, right? If new object, don't mutate but create new object in place...I don't have a reproduction right now, but tell me if you want me to build some for it or is it already handled somehow and the error is on my part.
Thanks