Fork me on GitHub
#pathom
<
2020-03-21
>
kwladyka17:03:48

Do you have ready solution to share for :com.wsscode.pathom.core/errors as EDN data instead of string?

kszabo17:03:53

::p/process-error (fn [env error] (Throwable->map error))

馃憤 4
wilkerlucio19:03:22

Hello folks, I would like to give more visibility around the work I do on Pathom and also on the rest of my open-source work. To improve this situation I've been working on a knowledge base for all my work, the idea is to use this so I can quickly add information and link related things, so you will see data around Pathom, around EQL, all linked and easy for me to update (meaning that will encourage me to update more often). On top of a knowledge base, this also works as journaling, so if you want to see the most recent stuff that I'm working on or thinking of, that's also a great place to check that! And finally, here is the link for this knowledge base: https://roamresearch.com/#/app/wsscode/page/WWmdSMHKY I would love to hear what you think about this format, any suggestions are welcome. Cheers!

馃憤 17
kszabo21:03:44

seems like a very useful tool, thanks for introducing it

Abhinav Sharma04:03:39

Pinned it to the channel

myguidingstar20:03:37

Thansks for sharing Wilker

kwladyka21:03:07

::p/process-error (fn [env error]
                                  (let [data (ex-data error)]
                                    (if (= :validation (:code data))
                                      (do (l/debug error)
                                          (update data :cause (partial keep spec-problems->errors)))
                                      (do (l/error error)
                                          {:type :error
                                           :code :unknown
                                           :cause "Unknown exception. The exception is logged and will be fixed."}))))
So far I have this if somebody is interested in. Finally I got conclusion I have to use exceptions to return any validation issue in pathom and it works well so far.

kwladyka21:03:04

(pc/defresolver all-users [{::keys [db]} _]
  {::pc/output [{:user/all [:user/id :user/name :user/email :user/created-at]}]}
  (vals (get @db :users)))
why :user/all vs :users? :user/all confuse of value all in user data. Is it some kind of standard in pathom? Can I use :users?

kszabo21:03:59

You can use :users if you want.

馃憤 4
kszabo21:03:18

It鈥檚 a domain modelling problem which is not a black-and-white situation