Fork me on GitHub
#om
<
2017-11-03
>
husayn18:11:44

Hey guys … I am trying to do remote mutations with om.next … I am able to send the mutation to the backend with

(defmethod mutatef 'upsert-user
  [{:keys [state ast]} key param]
  {:value {:keys [:app/current-user]}
   :remote true
   :auth-query ast})
the server side parser also returns
{:value {:keys [:app/current-user]}}
And my reconciler/send function
(POST "/auth-query"
            {:params {:query query}
             :handler (fn [response] (cb (rewrite response)))            
             :error-handler error-handler})
The problem is that, lets say the server takes 5seconds to process the mutation, how does the cb function know that it should re-read the keys returned in {upsert-user {:keys [:app/current-user]}} from the server ? Right now, it seems to re-read immediately the mutation is triggered eventhough it is a remote mutation, and does not re-read the keys the server responds with