Graphql 使用fetchPolicy=';缓存和网络&x27;apollo客户端中的in-useQuery未更新fetchMore上的缓存

Graphql 使用fetchPolicy=';缓存和网络&x27;apollo客户端中的in-useQuery未更新fetchMore上的缓存,graphql,apollo,apollo-client,graphql-js,Graphql,Apollo,Apollo Client,Graphql Js,我正在使用apollo客户端进行graphql设置。我有一个分页调用,我使用useQuery钩子返回的fetchMore函数来调用它。 在fetchMore函数中,我使用其updateQueryparam将新获取的数据附加到缓存中的结果中 fetchMore({ variables: { request: fetchMorerequest, }, updateQuery: (previousResult, { fetchMoreResult }) => { con

我正在使用apollo客户端进行graphql设置。我有一个分页调用,我使用
useQuery
钩子返回的
fetchMore
函数来调用它。 在
fetchMore
函数中,我使用其
updateQuery
param将新获取的数据附加到缓存中的结果中

fetchMore({
  variables: {
    request: fetchMorerequest,
  },
  updateQuery: (previousResult, { fetchMoreResult }) => {
   const updatedResults = update(previousResult, {
      list: {
        data: { $push: fetchMoreResult.list.data },
        hasMore: { $set: fetchMoreResult.list.hasMore },
      },
    });

  return updatedResults;
  },
});
这对我来说很好

现在,我已经将我的
fetchPolicy
从默认的
cache first
更改为
cache and network
。 更改之后,我从
updateQuery
函数返回的
updateResults
将反映在缓存中,但不会在组件中返回。我可以在chrome中的apollo扩展中看到缓存中的更新项。但是没有把它们放在我的组件中


你知道这里有什么问题吗?我错过什么了吗?请提供帮助。

在您的
defaultOptions
或当前查询选项中设置
nextFetchPolicy:'cache first'