1

当我relayStylePagination在 Apollo 客户端缓存类型策略中使用辅助函数时,即使我refetch手动调用该函数,更改传递给查询的变量也不会再次调用该查询。它完美地完成了fetchMore行为并合并了新数据。

我的缓存字段如下所示:

cache: new InMemoryCache({
      typePolicies: {
        Query: {
          fields: {
            inventories: relayStylePagination(),
          },
        },
      },
    })
4

1 回答 1

0

我需要refetch在传递新变量时手动调用。仍然不知道为什么添加中继类型策略会阻止refetch自动触发。

于 2021-12-27T11:03:53.340 回答