Fork me on GitHub
#om
<
2017-08-25
>
baptiste-from-paris07:08:45

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

baptiste-from-paris07:08:07

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

roklenarcic08:08:57

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

danielstockton08:08:22

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

roklenarcic08:08:27

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

roklenarcic08:08:56

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

danielstockton08:08:28

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

roklenarcic08:08:00

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]

roklenarcic08:08:10

let me grab the whole thing

roklenarcic08:08:33

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

roklenarcic08:08:54

and as far as reading goes, it works like intended

roklenarcic08:08:04

only mutation throws an error

roklenarcic08:08:48

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

roklenarcic08:08:20

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

danielstockton09:08:03

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

danielstockton09:08:16

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

danielstockton09:08:31

It must go through a join.

danielstockton09:08:02

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

roklenarcic10:08:19

I did what you suggested and now it works

roklenarcic11:08:12

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).

roklenarcic11:08:06

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

danielstockton11:08:56

It is a common gotcha

fenton22:08:20

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?