pathom3 icon indicating copy to clipboard operation
pathom3 copied to clipboard

Can't get proper output when client runs the same mutation multiple times

Open wilkerlucio opened this issue 3 years ago • 0 comments

Problem Analysis

Description

When a client makes a request invoking the same mutation multiple times, Pathom only returns the last response.

Example:

(pco/defmutation add-node [{:keys [id]}]
  (println "do" id) ; so you can see that both invocations happen
  {:id id})

(def env
  (pci/register
    [add-node]))

(comment
  (p.eql/process (assoc env :counter (atom 0))
    {:file/path "src/demos"}
    `[(add-node {:id "a"}) (add-node {:id "b"})]))

Problem

As a result, the user cannot know what happens to any call but the last one. The responses become unreachable.

The Solution Space

https://docs.google.com/spreadsheets/d/1M7DZyPJHjyWFVdAVv9JRJcRwEnHPRgRvcjxGZSFB6UE/edit#gid=0

wilkerlucio avatar Sep 22 '22 03:09 wilkerlucio