        :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]}]))

(ns workflo.macros.specs.query-test
  (:require [clojure.test :refer [are deftest is]]
            [clojure.spec :as s]
            [workflo.macros.query :as q]
            [workflo.macros.query.om-next :as om]
            [workflo.macros.specs.query]))

(deftest conforming-regular-properties
  (are [out in] (= out (q/conform in))

       :join-source {:name users :type :property}
       :join-target [{:name db/id :type :property}
                     {:name current-user :type :link :link-id _}]}]
    '[{users [db [id] [current-user _]]}]

    '[{:name users :type :join
       :join-source {:name users :type :property}
