Apollo Client – Demystifying Cache Normalization(apollographql.com)
apollographql.com
Apollo Client – Demystifying Cache Normalization
https://www.apollographql.com/blog/demystifying-cache-normalization/
1 comments
I have observed this same thing and found it unintuitive, but I think it makes sense? technically your `profile` field could be returning anything (even though you're passing an `id` param in, you potentially could be doing something like returning a sibling profile for the given id). iirc, there is a thing called "cache redirects" that let you teach apollo the right thing to do here.
Yup, you do it via type policies in v3
https://www.apollographql.com/docs/react/caching/advanced-to...
https://www.apollographql.com/docs/react/caching/advanced-to...
Ha, thanks! I mostly use Apollo iOS and didn't notice this, will check it out!
[deleted]
If the second query never made before the first query, even if they access the same object, it needs to make the network call again for the second query.
However, once you made all the queries, the normalization process will make sure the object is always fresh and there is no need for the extra network trip.