So... I'm using Apollo for local state management in my React app. I'm also using react-cookie
(which relies on react hooks internally).
I'd like to do something pretty basic:
const logout = async (_, args, {cache}) => {
const cookies = new Cookies()
cookies.removeCookie (`auth`)
cache.writeData ({data: {isAuthenticated: false}})
}
Problem is since I'm doing this outside a component, I can't use useCookies
and hence my components never get an update that it's been removed.
Thoughts?
I really don't want to have to choose between putting my state logic into a resolver and using React hooks. And I'm guessing the same thing would apply for redux.
Cheers!