Fork me on GitHub
#pathom
<
2022-09-14
>
njj15:09:16

Hello there, does anyone have any insight as to why this first defresolver works but the 2nd ends up in an unread? Working:

(pc/defresolver process-batch [{:keys [ast]} _params]
  {::pc/input #{}
   ::pc/output [:batch-jobs/process-batch]}
  {:batch-jobs/process-batch (auth/batch-process! (get-in ast [:params :payload]))})
Not Working:
(pc/defresolver process-batch [{:keys [ast]} _params]
  {::pc/input #{}
   ::pc/outuput [:batch-jobs/process-batch]}
  (let [payload (get-in ast [:params :payload])]
    {:batch-jobs/process-batch (auth/batch-process! payload)}))

Björn Ebbinghaus15:09:28

You have a typo: ::pc/outuput

Björn Ebbinghaus15:09:26

In the first case pathom can infer the attributes you produce by itiself, because you return a map directly.

njj15:09:38

I fixed the typo 😄, I had it correct in the local code

njj15:09:08

so for the 2nd one (not working), should I be more explicit about the map that this endpoint returns?

wilkerlucio19:09:04

not sure why it wouldn't work, the code looks equivalent to me, can you send a complete repro? maybe the problem is somewhere else

wilkerlucio19:09:15

(and I see you calling it batch, but I don't see the ::pc/batch? true flag, wondering if you are trying to use batch somehow, or its just a name coincidence)

njj19:09:57

thats just a name coincidence