Open alienfacepalm opened 4 years ago
It's intentional: https://github.com/apollographql/apollo-client/blob/master/CHANGELOG.md#apollo-client-260-1
https://github.com/apollographql/apollo-client/issues/3130#issuecomment-478409066
basically: cache-and-network
is not allowed on the one-shot query
method because there's no way for a one-shot query to return more than one result. Therefore cache-and-network
is only allowed for the watchQuery
method (which is used by the useQuery
hook). Try using the WatchQueryFetchPolicy
type instead of the FetchPolicy
type.
The
network-and-cache
fetchPolicy type seems to be missing from TypeScript options foruseApolloClient
which is not the case with theuseQuery
hook.Is this intended? Why doesn't it match the types for
useQuery
hook?