             [com.wsscode.pathom.connect :as pc]
             [com.wsscode.pathom.connect.foreign :as pcf]
             [com.wsscode.pathom.connect.planner :as pcp]
-            [com.wsscode.pathom.core :as p]))
+            [com.wsscode.pathom.core :as p]
+            [edn-query-language.core :as eql]))
 
 (deftest remove-internal-keys-test
   (is (= (pcf/remove-internal-keys {:foo                   "bar"

            ::pcf/join-node  [:z "bar"]})))

  (testing "inputs, with parent ident"
    (is (= (pcf/compute-foreign-query {::pcp/node {::pcp/requires {:a {}}
                                                   ::pcp/input    {:z {}}}
                                       ::p/path   [[:z "bar"] :a]
                                       ::p/entity {:z "bar"}})
           {::pcf/base-query [:a]

            ::pcf/join-node  [:z "bar"]}))

    (testing "with multiple inputs"
      (is (= (pcf/compute-foreign-query {::pcp/node {::pcp/foreign-ast (eql/query->ast [:a])
                                                     ::pcp/input       {:x {}
                                                                        :z {}}}
                                         ::p/path   [[:z "bar"] :a]
                                         ::p/entity {:x "foo"
                                                     :z "bar"}})
