        :join-source {:name user :type :link :link-id 1}
        :join-target [{:name db/id :type :property :alias db-id}
                      {:name name :type :property :alias nm}]}]
-    '[{[user 1] [db [id :as db-id]
-                 name :as nm]}]))
+    '[{[user 1] [db [id :as db-id] name :as nm]}]))
+
+(deftest om-next-query-for-joins-with-sub-aliases
+  (are [out in] (= out (-> in q/conform-and-parse om/query))
+    '[{[:user 1] [:db/id :name]}]
+    '[{[user 1] [db [id :as db-id] name :as nm]}]))

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

    '[[:property
       [:join

      {:name c :type :property}]
    '[a b c]))

(deftest om-next-query-for-regular-properties
  (are [out in] (= out (-> in q/conform-and-parse om/query))
    '[:a] '[a]
    '[:a :b] '[a b]
    '[:a :b :c] '[a b c]))

(deftest conforming-link-properties
  (are [out in] (= out (q/conform in))
    '[[:property [:link [a _]]]]
