Fork me on GitHub
#om
<
2016-10-30
>
alex-glv12:10:57

Hey.. Now that I am more familiar with parser and query syntax, I am building an app with Datomic on the back-end. Concerning mutations. Is there any link / interop between om.next tempid and Datomic tempid? I receive :result {:tempids 鈥 from mutation, what should I do with it ( in terms of optimistic updates) ? Or should I just re-read my remote keys?

anmonteiro20:10:30

@arohner oh so your problem is with links?

anmonteiro20:10:41

(looking at your example now)

arohner20:10:46

It is now 馃檪

arohner20:10:06

Links look closest to what I want to achieve, and would result in pretty clean code, if links triggered sends

anmonteiro20:10:31

I'll have to look at the issue you opened, but I think I know what's wrong with the example above

arohner20:10:33

I think the path we were going down yesterday was messy and got too involved in Om internals

anmonteiro20:10:19

@arohner so one thing though is that links aren't really supposed to be sent to the server

anmonteiro20:10:46

which is why adding :foo/bar to the top-level query effectively works for the case of your issue

arohner20:10:02

so if child queries for [[:foo/bar _]], I agree [[:foo/bar_]] shouldn鈥檛 be sent

arohner20:10:16

but I would expect that to result in a client-side read for [:foo/bar]

arohner20:10:40

and if client-side :foo/bar returns {:remote true}, that would be a send for :foo/bar

anmonteiro20:10:51

well it doesn't, really

anmonteiro20:10:13

Links are supposed to be used with db->tree

anmonteiro20:10:28

db->tree will understand that a link refers to a top level prop in the app state when it sees one

arohner21:10:19

right, so there鈥檚 no convenient way currently to combine db->tree with sends

arohner21:10:55

I got the recursive read stuff to work eventually yesterday, but it seemed to get into the internals too much, and without links, it wouldn鈥檛 render properly

anmonteiro21:10:05

@arohner they're meant for different purposes. if you want to modify / extract stuff from the query you send to the remote, you can manipulate the AST

arohner21:10:10

but then the recursive-read stuff would need to be extended to support links