diff --git a/src/main/com/wsscode/pathom3/connect/planner.cljc b/src/main/com/wsscode/pathom3/connect/planner.cljc index cc8942fb..50fde443 100644 --- a/src/main/com/wsscode/pathom3/connect/planner.cljc +++ b/src/main/com/wsscode/pathom3/connect/planner.cljc @@ -1590,6 +1590,9 @@ index-ast (coll/filter-vals (comp seq :children) (pf.eql/index-ast placeholder-ast)))) +(defn remove-parameterized-attributes [ast] + (eql/transduce-children (remove #(seq (:params %))) ast)) + (defn compute-non-index-attribute "This function deals with attributes that are not part of the index execution. The cases here are: @@ -1617,7 +1620,7 @@ (-> (add-placeholder-entry graph attr) (cond-> (empty? (:params ast)) - (-> (compute-run-graph* env) + (-> (compute-run-graph* (update env :edn-query-language.ast/node remove-parameterized-attributes)) (update ::index-ast merge-placeholder-ast ast)))))) (defn plan-mutation-nested-query [env {:keys [key] :as ast}] diff --git a/test/com/wsscode/pathom3/connect/runner_test.cljc b/test/com/wsscode/pathom3/connect/runner_test.cljc index c619064f..80215f5b 100644 --- a/test/com/wsscode/pathom3/connect/runner_test.cljc +++ b/test/com/wsscode/pathom3/connect/runner_test.cljc @@ -2927,11 +2927,10 @@ :y 20})))) (deftest run-graph!-placeholders-test - (is (graph-response? (pci/register (pbir/constantly-resolver :foo "bar")) - {} - [{:>/path [:foo]}] - {:foo "bar" - :>/path {:foo "bar"}})) + (is (check-serial (pci/register (pbir/constantly-resolver :foo "bar")) + {} + [{:>/path [:foo]}] + {:>/path {:foo "bar"}})) (is (graph-response? (pci/register (pbir/constantly-resolver :foo "bar")) {:foo "baz"} @@ -3021,7 +3020,7 @@ {:>/m3 [(:y {:m 3})]} {:>/m4 [(:y {:m 4})]}] {:x 10 - :y 30 + :y 20 :>/m2 {:x 10 :y 20} :>/m3 {:x 10