        [:join
         [:properties
          {[:simple users]
-          [[:prefixed-properties {:base db
-                                  :children [[:property [:simple id]]]}]
+          [[:prefixed-properties
+            {:base db
+             :children [[:property [:simple id]]]}]
            [:property [:link [current-user _]]]]}]]]]
     '[{users [db [id] [current-user _]]}]
 

    '[(a {b c d e})]

    '[[:parameterization
       {:query [:property [:join [:properties {[:simple a]
                                               [[:property [:simple b]]
                                                [:property [:simple c]]]}]]]
        :parameters {d e f g}}]]
    '[({a [b c]} {d e f g})]

    '[[:parameterization {:query [:aliased-property {:property [:simple a]
                                                     :as :as :alias b}]
                          :parameters {c d e f}}]]
    '[(a :as b {c d e f})]

    '[[:parameterization
       {:query [:aliased-property
                {:property [:join [:properties {[:simple a]
                                                [[:property [:simple b]]
                                                 [:property [:simple c]]]}]]
                 :as :as :alias d}]
        :parameters {e f g h}}]]
    '[({a [b c]} :as d {e f g h})]))


            [:join
             [:properties
              {[:simple friends]
               [[:property
                 [:join
                  [:properties
                   {[:simple friends]
                    [[:prefixed-properties
                      {:base db
                       :children
                       [[:property [:simple id]]]}]]}]]]]}]]]]}]]]]
    '[{users [{friends [{friends [db [id]]}]}]}]))

(deftest parsing-joins-with-sub-joins
  (are [out in] (= out (q/conform-and-parse in))
    '[{:name users :type :join
       :join-source {:name users :type :property}
       :join-target
       [{:name db/id :type :property}
        {:name user/name :type :property}
        {:name friends :type :join
         :join-source {:name friends :type :property}
         :join-target [{:name db/id :type :property}
                       {:name user/name :type :property}]}]}]
    '[{users [db [id]
              user [name]
              {friends [db [id]
