pathom

Pragyan Tripathi 2023-10-13T11:34:56.826799Z

While trying out following example from the docs:

(pco/defresolver full-name [{::keys [first-name last-name]}]
  {::full-name (str first-name " " last-name)})

(def env (pci/register full-name))

(p.eql/process env
  [{'(:>/bret {::first-name "Bret" ::last-name "Victor"})
    [::full-name]}])
I get following error:
Execution error (ExceptionInfo) at com.wsscode.pathom3.connect.planner/verify-plan!* (planner.cljc:1694).
; Pathom can't find a path for the following elements in the query: [:com.vadelabs.bridge-restapi.core/full-name] at path [:>/bret]
Any ideas on how to fix it?

Pragyan Tripathi 2023-10-13T13:02:36.094419Z

Resolved it. Just needed to install _pbip_/placeholder-data-params plugin.

timovanderkamp 2023-10-13T11:38:52.438839Z

Hi, I am trying to parallel process resolvers that take some time to resolve. For some reason when the resolvers have input, they are not being ran in parallel. Is there something that can be done about this? This example takes 1 second to resolve, as expected

(pco/defresolver parallel-1 [_ _]
  {::pco/output [:parallel-1]}
  (p/do!
   (p/delay 1000)
   {:parallel-1 1}))

(pco/defresolver parallel-2 [_ _]
  {::pco/output [:parallel-2]}
  (p/do!
   (p/delay 1000)
   {:parallel-2 2}))

(def p-env (-> {::p.a.eql/parallel? true} (pci/register [parallel-1 parallel-2])))

(comment

 (let [start (js/Date.)]
   (p/then
    (p.a.eql/process p-env [:parallel-1 :parallel-2])
    (fn [res]
      (println res :took (- (.getTime (js/Date.)) start)))))
 )
This example takes 2 seconds to resolve
(pco/defresolver parallel-1 [_ _]
  {::pco/input [:parallel-1/id]
   ::pco/output [:parallel-1/id
                 :parallel-1/value]}
  (p/do!
   (p/delay 1000)
   {:parallel-1/id 1
    :parallel-1/value "value"}))

(pco/defresolver parallel-2 [_ _]
  {::pco/input [:parallel-2/id]
   ::pco/output [:parallel-2/id
                 :parallel-2/value]}
  (p/do!
   (p/delay 1000)
   {:parallel-2/id 2
    :parallel-2/value "value"}))

(def p-env
  (-> {::p.a.eql/parallel? true}
      (pci/register [parallel-1 parallel-2])))

(comment

 (let [start (js/Date.)]
   (p/then
    (p.a.eql/process p-env [{[:parallel-1/id 1] [:parallel-1/value]}
                            {[:parallel-2/id 2] [:parallel-2/value]}])
    (fn [res]
      (println :took (- (.getTime (js/Date.)) start)))))
 )

timovanderkamp 2023-10-16T07:54:03.680839Z

Thanks Wilker

wilkerlucio 2023-10-14T16:35:58.204809Z

thanks for the report, I can confirm its a bug, its not parallelizing the idents

wilkerlucio 2023-10-14T16:38:36.160309Z

https://github.com/wilkerlucio/pathom3/issues/208

wilkerlucio 2023-10-14T18:32:36.041239Z

fixed on main