Why do you need and how to use viewer
correctly in Relay.js?
I've spent past week to try and understand Relay.js. Im now good with GraphQL and I understand it pretty well but Im having some issues with uniting GraphQL and Relay.js in same application.
First step would probably be to understand viewer
. I've seen many examples and tutorials using it but it's never explained and it's not very clear what is it exactly and what it is used for.
Relay documentation mentions viewer
few times but there's not even a single word explaining it.
I wish I could something more to this question but Im afraid there's no explanations online. It's only used in codes and ripping it out of context wouldn't make any sense. Answering this question will require some knowledge about Realy.js/GraphQL anyway.
My best guess based of countless examples I've examined is that it's somehow related to user? If user is anonymous or logged in? To grant different access to data based on login status or user level?