Apollo client 如何为Apollo GraphQL客户端禁用InMemoryCache?

Apollo client 如何为Apollo GraphQL客户端禁用InMemoryCache?,apollo-client,apollo-cache-inmemory,Apollo Client,Apollo Cache Inmemory,我试图完全禁用apollo客户端上的缓存,但它不起作用 我已尝试将fetchPolicy设置为“仅网络”或“无缓存”。是否有我遗漏的内容?只要在需要清理缓存时删除persistor即可 const persistor = new CachePersistor({ cache: this.cache, storage: window.sessionStorage as any }); await persistor.remove();

我试图完全禁用apollo客户端上的缓存,但它不起作用


我已尝试将fetchPolicy设置为“仅网络”或“无缓存”。是否有我遗漏的内容?

只要在需要清理缓存时删除persistor即可

  const persistor = new CachePersistor({ cache: this.cache, storage: window.sessionStorage as any });
  await persistor.remove();