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

      {:name a/d :type :property :alias e}]
    '[a [b :as c d :as e]]))

(deftest conforming-parameterization
  (are [out in] (= out (q/conform in))
    '[[:parameterization {:query [:property [:simple a]]

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

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

(deftest conforming-aliased-links
  (are [out in] (= out (q/conform in))
    '[[:aliased-property {:property [:link [a _]] :as :as :alias b}]]
