pathom

:pathom: https://github.com/wilkerlucio/pathom/ & https://pathom3.wsscode.com & https://roamresearch.com/#/app/wsscode
souenzzo 2020-07-14T18:10:46.296900Z

Comment any node of this query, and it will work but these nodes causes a exception

(let [parser (ps/connect-serial-parser
               {::ps/connect-reader pc/reader3}
               [(pc/constantly-resolver :f "f")
                (pc/constantly-resolver :e "e")])]
  (parser {}
          '[{:>/a [(:e {:p :p1})]}
            {:>/b [(:e {:p :p2})]}
            {:>/c [:f]}
            {:>/d [:f]}]))

souenzzo 2020-07-15T12:15:49.298100Z

I end up seen that the issue is: When you try to merge to nodes with different params, the merge returns nil lift-placeholders ignores the "nil" and continue working and create wired results

souenzzo 2020-07-15T12:17:45.298300Z

i think that maybe merge-queries should throw something like can't merge nodes a and b But sure, it's a breaking change, so pc/reader4

wilkerlucio 2020-07-15T13:28:55.300500Z

nah, reader3 is mostly an experiment, and tbh I think the merge-queries shouldnt be like that, Im considering making the planner aware of placeholders so he can deal with it directly, this may be a better way to avoid those

souenzzo 2020-07-14T18:28:31.297Z

@wilkerlucio should I open a issue?

souenzzo 2020-07-14T19:04:14.297200Z

(p/lift-placeholders-ast {}
                         {:type     :root
                          :children [{:type         :join
                                      :dispatch-key :>/a
                                      :key          :>/a
                                      :children     [{:type :prop :dispatch-key :e :key :e}]}
                                     {:type         :join
                                      :dispatch-key :>/b
                                      :key          :>/b
                                      :children     [{:type :prop :dispatch-key :e :key :e :params {}}]}
                                     {:type         :join
                                      :dispatch-key :>/c
                                      :key          :>/c
                                      :children     [{:type :prop :dispatch-key :f :key :f}]}
                                     {:type         :join
                                      :dispatch-key :>/d
                                      :key          :>/d
                                      :children     [{:type :prop :dispatch-key :f :key :f}]}]})

souenzzo 2020-07-14T19:25:19.297400Z

I think that it's the root

(p/merge-queries 
  [:a]
  '[(:a {})])