omcljs / om

ClojureScript interface to Facebook's React
6.66k stars 362 forks source link

Can't add custom children on remote ast #888

Closed wilkerlucio closed 6 years ago

wilkerlucio commented 6 years ago

I found one issue with the current implementation for the ast->expr regarding mutation joins. Given this case:

(def parser (om/parser {:mutate (fn [{:keys [ast]} _ _]
                                  {:remote (assoc ast :children (:children (om/query->ast [:id])))})}))

(parser {} [`(do-something {:foo "bar"})] :remote)
; expected => `[{(do-something {:foo "bar"}) [:id]}]
; current  => `[{(do-something {:foo "bar"}) nil}]

The children are not getting to the final query output.