Fork me on GitHub
#pathom
<
2020-07-14
>
souenzzo18:07:46

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]}]))

souenzzo18:07:31

@U066U8JQJ should I open a issue?

souenzzo19:07:14

(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}]}]})

souenzzo19:07:19

I think that it's the root

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

wilkerlucio05:07:48

yes, open the issue please 🙏

souenzzo12:07:49

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

souenzzo12:07:45

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

wilkerlucio13:07:55

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