Hello, does anyone struggle to have the same node props computed on the client and on the server
:value
and :required
are never computed the same @home
Has anyone had this error happen when invoking mutations: "No queries exist for component path (meds.core/Root meds.core/MedicationsTab meds.core/MedList)"
Yes @roklenarcic, usually it means you're stealing queries and they don't compose properly.
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
Is using ~@(om/get-query ....) a bad thing in that regard?
Not necessarily, it depends how. Can you show your query?
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]
let me grab the whole thing
om/get-query Root returns [:ui/react-key :nav-expanded {:med-lists [:level :selected {:items [:id :name :level]}]}]
and as far as reading goes, it works like intended
only mutation throws an error
hm I guess by using ~@(om/get-query MedicationsTab) I lose metadata
is there another way to compose multiple component into the root query?
You need to give it a key like {:medications ~(om/get-query MedicationsTab)}
You can't include child queries directly in the parent, this is what 'stealing' refers to.
It must go through a join.
This is so that om can construct a clear path through the component hierarchies (and what No queries exist for component path refers to)
I did what you suggested and now it works
thank you
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).
and the idea that any two vectors are interchangeable as long as contents are the same
It is a common gotcha
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?