These are chat archives for jdubray/sam

7th
May 2018
Jean-Jacques Dubray
@jdubray
May 07 2018 00:04
Jean-Jacques Dubray
@jdubray
May 07 2018 02:26
Interesting to see Apollo Client 2.0 entering the application state management: they are clearly targeting redux, with just queries and mutations. https://youtu.be/eHjP2WFt0zU
devin ivy
@devinivy
May 07 2018 02:29
yep—i've noticed many developers noticing this recently
seems like it's verging on a serious trend... what do you think of that approach @jdubray ?
Jean-Jacques Dubray
@jdubray
May 07 2018 02:31
Well they keep pounding on "just queries and mutations", as we (at least I) know actions and state will be critically missing from that model. It's unfortunate we are taking some steps backwards.
devin ivy
@devinivy
May 07 2018 02:33
i can see "mutations" as being used just like actions. it's the "queries" part that i struggle with.
unless apollo client only implements the model, and don't encompass actions + state
Jean-Jacques Dubray
@jdubray
May 07 2018 02:34
In SAM everything is an action. Both queries and mutations change the application/client state.
Unfortunately CQRS is leaking into the client, not a good idea.
devin ivy
@devinivy
May 07 2018 02:35
why is cqrs not suited to any part of the client?
Jean-Jacques Dubray
@jdubray
May 07 2018 02:36
Of course queries and mutations are rather syntactic, so we can do what we need to do.
CQRS is a pattern for systems of record, the application state is not at that level, I don't see any benefit.
CQRS facilitates the persistence of the application state into systems of record, but they are very different in nature.
In other words your client code should not know if this is a query or command.
Jean-Jacques Dubray
@jdubray
May 07 2018 02:41
From SAM's perspective, the important distinction is async vs sync, which tend to align with queries and commands.
Jean-Jacques Dubray
@jdubray
May 07 2018 11:32
That being said, the query/mutation dichotomy is essential in GraphQL since one is used to navigate data, while the other is used to update it, but in that case, a client-side GraphQL query is "polling" that State Representation, while a Server-side query is mutating the application state (albeit not mutating the systems of record state). I believe these distinctions are important.