Confusion on when you need to use keyfields false for typepolicy

Hello,

I looked at the documentation but i still feel like something is missing. I understand that you should set keyfields for a given type to false when you would like apollo-client TO NOT normalize and cache it. I’m assuming that this only makes sense when your type contains an “id” or “_id” field. If this is the case, does this mean for any type that does not contain an id and should always be embedded in it’s part there is no need to specify “keyfields: false” since apollo will not attempt to normalize it in the first place?

We have some type policies like shown below and i’m trying to understand if keyfields false needs to be added or is implied by the apollo-client and hence not necessary.

const client = new ApolloClient({
  link: authLink.concat(httpLink),
  cache: new InMemoryCache({
    typePolicies: {
      Address: { // <-- here
        merge: true,
      },
    },
  }),
});
1 Like