Apollo Client (fetch-policy & nextFetchPolicy)

Hi there! I have a question:

If we use hook useQuery with fetchPolicy: ‘network-only’ & nextFetchPolicy: ‘cache-first’ we’ll get next results:

  1. First mount of hook: cache is empty, request send, everything works fine
  2. Second mount of hook: returns data from cache but request sends again

Why in second case request sends if we use nextFetchPolicy ‘cache-first’?

@apollo/client 3.6.9 version

fetchPolicy is used every time the query mounts. nextFetchPolicy is used for every query execution after the query is already mounted (e.g. cache updates).

If nextFetchPolicy is used only after cache updates - why the useQuery hook returns data from cache with ‘fetchPolicy: ‘network-only’, nextFetchPolicy: ‘cache-first’’ with second hook mount?

Not sure. It’s not supposed to.