Fork me on GitHub
#om
<
2017-10-25
>
souenzzo02:10:15

There is some integration from om "pull pattern" to graphql? Is possible to translate one to other? Some tutorial/docs/how to?

souenzzo02:10:42

Are these ideas right? 1- Given an application state, I can generate a "pull pattern" with all data needed to render this state. 2- given these pull pattern, I can make a single/unique request from server and get all data back 3- Once the backend knows last client query, it can send a websocket message with a "refresh"

roklenarcic08:10:21

How do I tell transact! that I want all components that use a certain ident rerendered. In transact! call I can specify reads after mutations, so I want to specify something like [:person/by-id 2], but that doesn't seem to work.

wilkerlucio09:10:20

@souenzzo seems accurate, but instead of "pull pattern" we usually call it "query"

wilkerlucio09:10:27

@souenzzo although not documented yet, in Pathom I've written some helpers to convert from Om Graph Query to GraphQL: https://github.com/wilkerlucio/pathom/blob/master/src/com/wsscode/pathom/graphql.cljc

wilkerlucio09:10:53

@roklenarcic you should not specify the ident, but the attributes that you need refresh, it's recommended to think on the attributes, not the entities, so you get a more targeted refresh

wilkerlucio09:10:27

if you really need you could use the attribute :person/id, since all of your persons probably have it, but still, better to say the attributes you need refresh, it's usually clear what they are after a mutation

alasdair09:10:41

I was playing with a basic devcards setup and am seeing something I don't understand - I create a card with a component and state map. With no query specified I can fetch the component props fine, but if I specify a query the props values comes back as empty atoms. Does anyone know what is going on?

roklenarcic09:10:19

@wilkerlucio but that will refresh render of all persons, not of the single one

roklenarcic11:10:05

when I add data to entities in mutations, do I need to take care of normalization myself?

danielstockton11:10:18

@souenzzo I had a go at this at one point:

danielstockton11:10:56

Seemed perfectly possible but I didn't polish it.

wilkerlucio12:10:42

@roklenarcic yes about normalization, you have to do it yourself on mutations

wilkerlucio12:10:36

and yes about all the persons, and that's fine, remember that if you transact sending the component as the reference, that component will be automatically updated, no need for refresh

wilkerlucio12:10:54

that's the most common case for ident refresh, the component itself that triggered the transaction

wilkerlucio12:10:10

otherwise just go by keys, unless you find a case that gets too slow, on my experience it just works fine

roklenarcic12:10:21

@wilkerlucio The usual case is that I have a list of entities then I have a popup editing the entity. The save transaction uses the popup as it's ref, but I'd like the list item to be updated as well. Both have same ident. I guess that's one "hole" in the om.next model, I need to rerender all items in the list by specifying an attribute of the person

wilkerlucio12:10:11

did you tried sending the :person/id? the performance hit is too much?

roklenarcic18:10:52

Nah it will prob be fine

roklenarcic18:10:16

Don't have that much data. But I always like to keep lookout of optimal ways of doing things