Apollo GraphQl react. How to clear query cache for all variable combinations?

前端 未结 4 806
遥遥无期
遥遥无期 2021-02-12 10:34

I am using apollo graphql in my react application. Say I have the following query:

query ListQuery($filter: String!) {
   items(filter: $filter) {
     id
     n         


        
4条回答
  •  终归单人心
    2021-02-12 11:11

    Read about fetch policies options.fetchPolicy

    --Edit:--

    But it is only as a trick if you want reset only one query. To reset all store see answer by @Nitin : Set fetchPolicy to network-only. Refresh query. Return it to option of your choice.

提交回复
热议问题