I've made the issue here in apollo-client repository.
It works well with other fetchPolicy options but it doens't work correctly with cache-and-network.
Before resolving the issue, here is one of the alternatives.
alternative
Starting polling manually
const {
    data: todosData,
    error,
    startPolling,
    stopPolling,
  } = useQuery(GET_TODOS, {
    fetchPolicy: "cache-and-network",
  });
  useEffect(() => {
    startPolling(1000); // poll interval
    return () => {
      stopPolling();
    };
  }, []);
 
 
              
 
    
Top comments (0)