om

Please ask the channel first, not @dnolen directly!
souenzzo 2017-10-25T02:33:15.000072Z

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

souenzzo 2017-10-25T02:36:42.000081Z

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"

roklenarcic 2017-10-25T08:08:21.000158Z

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.

wilkerlucio 2017-10-25T09:06:20.000245Z

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

wilkerlucio 2017-10-25T09:07:27.000105Z

@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

wilkerlucio 2017-10-25T09:07:47.000082Z

you can find example usages on the tests: https://github.com/wilkerlucio/pathom/blob/master/test/com/wsscode/pathom/graphql_test.cljc

👍 1
wilkerlucio 2017-10-25T09:08:53.000267Z

@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

wilkerlucio 2017-10-25T09:09:27.000021Z

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

2017-10-25T09:43:41.000093Z

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?

roklenarcic 2017-10-25T09:59:19.000481Z

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

roklenarcic 2017-10-25T11:02:05.000394Z

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

2017-10-25T11:40:18.000026Z

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

2017-10-25T11:40:18.000444Z

https://github.com/danielstockton/omql

👍 1
2017-10-25T11:40:56.000222Z

Seemed perfectly possible but I didn't polish it.

wilkerlucio 2017-10-25T12:00:42.000260Z

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

wilkerlucio 2017-10-25T12:01:36.000468Z

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

wilkerlucio 2017-10-25T12:01:54.000426Z

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

wilkerlucio 2017-10-25T12:02:10.000261Z

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

roklenarcic 2017-10-25T12:17:21.000191Z

@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

wilkerlucio 2017-10-25T12:53:11.000293Z

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

roklenarcic 2017-10-25T18:24:52.000339Z

Nah it will prob be fine

roklenarcic 2017-10-25T18:25:16.000114Z

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