通过阅读中继文档,我对网络层(https://facebook.github.io/relay/docs/en/network-layer.html)和中继存储(https://facebook.github.io/relay/docs/en/relay-store.html)中提到的缓存概念感到困惑。
这是两个不同的缓存吗?哪一项会自动由Relay收集垃圾?
发布于 2018-11-30 19:02:47
@ on在网络层是如何将客户端连接到您的GraphQL服务器,在您的应用程序上创建存储,以缓存数据。第二个链接更多的是关于如何在运行突变之后使用updater函数更新store。
正如您在第一个链接中看到的:
// Create a network layer from the fetch function
const network = Network.create(fetchQuery);
const store = new Store(new RecordSource())您正在使用relay-runtime包创建网络层/存储区。
希望它能有所帮助:)
https://stackoverflow.com/questions/53527851
复制相似问题