I am running into an issue, where writes to the DB are not showing up after a navigate call. But do show up on a manual refresh.
I have the following getCurrentUser code - see getCurrentUser method
If the user does not have a team, I am directing them to a pickTeam page. On this team page, after onCompleted of the mutation, I am navigation to a page. After the redirect to the page, the currentUser method returns an empty team, even though it was just created by Prisma.
Ive tried doing delays with
await new Promise(r => setTimeout(r, 1000)); but it does not help.
currentUser.currentTeam returns null after navigate, but returns an object after a browser refresh.
Why is this happening? is this caching on prisma? or RW caching the currentUser data?
My current workaround is to do a