1 minute read | 2 months ago
When I was building a mobile app using Expo I encountred a problem where, if a user is logged out, and a diffrent user is logged in (Without reloading the app or closing it). When a request is sent to the server, it uses the data of the previous user to make requests. After days of debugging, I came to realize that, I had to set my fetchPolicy to no-cache, so that Apollo Graphql won't cache my data.
Previously
It should have been
Reference: Apollo useQuery