 (defn network-updates [updates]
   (plans-query `[(plans/network-updates {:updates ~updates})])
   true) ;; for deferred
+
+(defn update-edge-marker-mid [edge]
+  (plans-query `[(plans/edge-marker-mid {:edge ~edge})]))
            edge-id (if (not (node-id? update-uid))
                      (composite-key plid update-uid))
            edge (if edge-id (get edge-by-plid-id edge-id))
            edge-by-plid-id (if edge
                              (assoc edge-by-plid-id edge-id
                                (assoc edge :edge/state state))
                              edge-by-plid-id)]
        (recur edge-by-plid-id (first more) (rest more))))))


   (let [edge-id (edge-key-fn edge)
         ref [:edge/edge-by-plid-id edge-id]]
     #(swap! state update-in ref merge edge))})

(defmethod plans-mutate 'plans/edge-marker-mid
  [{:keys [state]} _ {:keys [edge]}]
  {:value {:keys comp/edge-query}
   :action #(swap! state update-in [:edge/edge-by-plid-id (edge-key-fn edge) :edge/marker-mid]
                   (fn [_]
                     (:edge/marker-mid edge)))})

(defonce plans-parser (om/parser {:read plans-read :mutate plans-mutate}))

