You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Doubt 1: Earlier we had to explicitly tell that we wanted to fetch trainer object after mutation is done, what is being returned now, with only id being returned after mutation? What does it exactly mean?
It's written for the trainer object that
What this does, is telling Apollo Client to refetch the trainer object and all its related pokemons whenever we create a new pokemon. Apollo Store identifies the trainer object by its id and it basically merges the known pokemons with all the pokemons in the mutation response. Even though this is highly inefficient, this works in our example.
Doubt 2: Does the above holds true only after we have added dataIdFromObject: o => o.id in ApoloClient instantiation ?
The text was updated successfully, but these errors were encountered:
Doubt 2: Does the above holds true only after we have added dataIdFromObject: o => o.id in ApoloClient instantiation ?
Yes 🙂
Before, we would query not only the newly created pokemon id, but actually the trainer and all the pokemon he owns. By adding the forceFetch option (this is by the way renamed to forcePolicy in the latest Apollo version), we are querying the whole trainer whenever we visit the route again.
In the tutorial it is written that after adding
Why could we remove
and replace it just with
id
.Doubt 1: Earlier we had to explicitly tell that we wanted to fetch trainer object after mutation is done, what is being returned now, with only
id
being returned after mutation? What does it exactly mean?It's written for the trainer object that
Doubt 2: Does the above holds true only after we have added
dataIdFromObject: o => o.id
in ApoloClient instantiation ?The text was updated successfully, but these errors were encountered: