Reset store after logout with Apollo client

前端 未结 4 2015
深忆病人
深忆病人 2021-02-19 07:46

I\'m trying to reset the store after logout in my react-apollo application.

So I\'ve created a method called \"logout\" which is called when I click on a button (and pas

4条回答
  •  情话喂你
    2021-02-19 08:00

    If you need to clear your cache and don't want to fetch all active queries you can use:

    client.cache.reset()

    client being your Apollo client.

    Keep in mind that this will NOT trigger the onResetStore event.

提交回复
热议问题