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

前端 未结 4 805
遥遥无期
遥遥无期 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 10:54

    Try this:

     query ListQuery($filter: String!) {
           items(filter: $filter) {
             id
             name
           }
        },
        fetchPolicy: 'no-cache'
    

    More here: https://www.apollographql.com/docs/react/caching/cache-interaction/#bypassing-the-cache

提交回复
热议问题