Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should be an way of not updating "immutable" fields of a data, but replacing with new one #238

Open
outerlook opened this issue Jul 23, 2021 · 0 comments

Comments

@outerlook
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant