om

Please ask the channel first, not @dnolen directly!
baptiste-from-paris 2017-08-25T07:43:45.000217Z

Hello, does anyone struggle to have the same node props computed on the client and on the server

baptiste-from-paris 2017-08-25T07:44:07.000075Z

:value and :required are never computed the same @home

roklenarcic 2017-08-25T08:00:57.000200Z

Has anyone had this error happen when invoking mutations: "No queries exist for component path (meds.core/Root meds.core/MedicationsTab meds.core/MedList)"

2017-08-25T08:02:22.000114Z

Yes @roklenarcic, usually it means you're stealing queries and they don't compose properly.

roklenarcic 2017-08-25T08:02:27.000091Z

The page renders without errors, including the querying and reads (on this path included), but when I call (om/transact! this `[mutation]), where this is an instance of MedList, I get that error

roklenarcic 2017-08-25T08:03:56.000374Z

Is using ~@(om/get-query ....) a bad thing in that regard?

2017-08-25T08:04:28.000193Z

Not necessarily, it depends how. Can you show your query?

roklenarcic 2017-08-25T08:06:00.000286Z

Root: `[:ui/react-key @(om/get-query MainNav) @(om/get-query MedicationsTab)] MedicationsTab: `[{:med-lists ~(om/get-query MedList)}] MedList: `[:level :selected {:items ~(om/get-query MedListItem)}] MedListItem: [:id :name :level] MainNav: '[:nav-expanded]

roklenarcic 2017-08-25T08:06:10.000179Z

let me grab the whole thing

roklenarcic 2017-08-25T08:07:33.000061Z

om/get-query Root returns [:ui/react-key :nav-expanded {:med-lists [:level :selected {:items [:id :name :level]}]}]

roklenarcic 2017-08-25T08:07:54.000392Z

and as far as reading goes, it works like intended

roklenarcic 2017-08-25T08:08:04.000076Z

only mutation throws an error

roklenarcic 2017-08-25T08:40:48.000293Z

hm I guess by using ~@(om/get-query MedicationsTab) I lose metadata

roklenarcic 2017-08-25T08:50:20.000121Z

is there another way to compose multiple component into the root query?

2017-08-25T09:29:03.000245Z

You need to give it a key like {:medications ~(om/get-query MedicationsTab)}

2017-08-25T09:29:16.000263Z

You can't include child queries directly in the parent, this is what 'stealing' refers to.

2017-08-25T09:29:31.000252Z

It must go through a join.

2017-08-25T09:30:02.000179Z

This is so that om can construct a clear path through the component hierarchies (and what No queries exist for component path refers to)

roklenarcic 2017-08-25T10:13:19.000057Z

I did what you suggested and now it works

roklenarcic 2017-08-25T10:13:20.000189Z

thank you

👍 1
roklenarcic 2017-08-25T11:09:12.000115Z

The need of keeping those vectors intact needs to be mentioned in big bold letters somewhere. It kinda goes against the basic clojure premise (manipulate and combine data to achieve composability).

roklenarcic 2017-08-25T11:10:06.000332Z

and the idea that any two vectors are interchangeable as long as contents are the same

2017-08-25T11:32:56.000194Z

It is a common gotcha

fenton 2017-08-25T22:42:20.000150Z

I'm trying to setup a client server architecture where I have token authentication. I'd like to pass the token to the server with each remote send message. However the the remote function only gets the query. I feel weird about dipping into the app-state of the client to get the token as that seems to be an anti-pattern for functional programming. Is there a good reason why the remote send function isn't passed the Environment, Key and Parameters, like the reader is?