Update the viewer
Closed this issue · 3 comments
Hey, I have an issue updating the viewer. I use react-router to fast load the components. My problem is that I don't know how to reload the viewer. It only reloads when I refresh the page, and that's not what I want.
Hi, that shouldn't happen, you're right. What version are you using?
I suspect that your're on a version prior to 1.0.0. Because of the anonymous user (which was removed in this commit), we had to use a constant id for the current user (see here and here). If you don't use the same id, Relay does not know, that the user after login should replace the anonymous user object from before.
The new versions from 1.0.0 on are not using the anonymous user anymore but some flags like isLoggedIn on the viewer type. This is a lot cleaner, because you don't need to use the roles anymore on the client and this confusing requirements, that most probably led to your reloading issue, are gone.
Did this help you?
Thanks, i was using an old version.