Fork me on GitHub
#om
<
2016-09-03
>
iwankaramazow18:09:54

How is a login generally implemented? As a remote read or a remote mutate ?

hueyp19:09:35

this isn’t an om specific answer, but its common in graphql / relay type things to keep login separate — reasons being: local state can be very user specific — easier to just blow it away — and many of the times your server parser assumes a user.

hueyp19:09:14

so I generally do a basic login page that posts / redirects into an om / relay / etc app

iwankaramazow19:09:23

I just came of a project with graphql/relay 😄

iwankaramazow19:09:56

I'm trying to follow the same flow, but

iwankaramazow19:09:17

I think I need to post process remote mutate stuff to merge it under the right keys

hueyp19:09:32

so in relay there is no invalidate concept (in om you can make one — you control the cache) so its hard to switch users because you can’t clean the cache

hueyp19:09:17

I haven’t done vanilla om.next in awhile, but yah, we have a custom remote merge function

iwankaramazow19:09:32

In relay I mutated the viewer between an 'anonymous' role & an 'authenticated' role.