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]}]))
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
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
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
@wilkerlucio should I open a issue?
(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}]}]})
I think that it's the root
(p/merge-queries
[:a]
'[(:a {})])