Did: Ran (om/transact! this [(do/this) :read/that])
Expected: Components with read :read/that to have their query to be sent remotely and get an answer back.
Happened: Only one of the components with :read/that got all of its data.
Narrowed it down to transform-reads returning reads where more than one read had the same root join. The stock om/parser returns a map for read values and will only return one result for each key, in this case one result for each join.
We used the om/parser both client and server side, resulting in us not getting all the data we needed back from the server.
Minimal case with reads, render and reconciler code omitted:
Did: Ran
(om/transact! this [(do/this) :read/that])
Expected: Components with read:read/that
to have their query to be sent remotely and get an answer back. Happened: Only one of the components with:read/that
got all of its data.Narrowed it down to
transform-reads
returning reads where more than one read had the same root join. The stockom/parser
returns a map for read values and will only return one result for each key, in this case one result for each join.We used the
om/parser
both client and server side, resulting in us not getting all the data we needed back from the server.Minimal case with reads, render and reconciler code omitted:
Minimal repro: https://gist.github.com/petterik/0858c903d470be1245314c9b640a00c5
Possible solution: Merge queries by their joins, where:
Would be merged on :join/parent to: