中继现代缓存与存储

时间:2018-11-28 20:47:25

标签: graphql relay relaymodern

通读中继文档,我对网络层(https://facebook.github.io/relay/docs/en/network-layer.html)与中继存储(https://facebook.github.io/relay/docs/en/relay-store.html)中提到的缓存概念感到困惑。

这两个不同的缓存吗?中继自动收集哪个垃圾?

1 个答案:

答案 0 :(得分:0)

@在网络层上,是如何将客户端连接到GraphQL服务器,在应用程序上创建存储以缓存数据的方式。第二个链接是有关例如在运行突变后如何使用store函数更新updater的信息。

在第一个链接上可以看到:

// Create a network layer from the fetch function
const network = Network.create(fetchQuery);
const store = new Store(new RecordSource())

您正在使用relay-runtime包创建网络层/存储。

希望它会有所帮助:)

相关问题