I’m running into an issue where the returned data of mutations is not synchronizing with the query data in the Redux cache.
I have a simple example of a user profile form using Apollo. The container has 1 query
viewer which returns a
PublicUser type with a profile object. It also has a mutation called
updateViewerProfile that updates the user’s profile. The mutation returns the type
PublicUser with a profile object as well.
For example, when I fetch the user profile in the query it comes back as expected with a
profile.name field of
"Ted". Then when I call the mutation with an updated
name field of
"Bob" the response I get back in the mutation has a profile with the name of Bob. However, the cached data in the query has a name of Ted.
Is there a way around this? Having duped data on mutations and queries is a deal breaker for me but I wanted to check if anyone had a solution before I switched to the core apollo-client API.