This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-14
Channels
- # announcements (40)
- # aws (9)
- # babashka (21)
- # beginners (75)
- # calva (56)
- # chlorine-clover (1)
- # cider (12)
- # circleci (1)
- # clj-kondo (7)
- # cljsrn (13)
- # clojars (3)
- # clojure (171)
- # clojure-dev (11)
- # clojure-europe (64)
- # clojure-nl (11)
- # clojure-spec (6)
- # clojure-uk (9)
- # clojurescript (31)
- # conjure (1)
- # cursive (7)
- # datascript (7)
- # datomic (9)
- # emacs (4)
- # fulcro (65)
- # introduce-yourself (1)
- # jobs-discuss (7)
- # kaocha (7)
- # lsp (39)
- # missionary (5)
- # off-topic (54)
- # pathom (10)
- # re-frame (6)
- # shadow-cljs (110)
- # tools-deps (41)
Is there a tool I can use to visualise my pathom3 index?
Found it: https://pathom3.wsscode.com/docs/debugging/#debug-with-pathom-viz
In the pathom viz tool I get: > Entity data requires Pathom 2.4.0+ > Or latest Pathom 3 from Git I’m using [com.wsscode/pathom3 “2021.08.14-alpha”] do I need to be newer than that?
still having issues? a common one is to use the wrong namespace to start the connector
@caleb.macdonaldblack no. when this was written, the only way to get pathom3 was from git. these alpha releases are pretty new.
👍 2
Im trying to follow some pathom3 examples
(def users-db
{1 #:acme.user{:name "Usuario 1"
:email ""
:birthday "1989-10-25"}
2 #:acme.user{:name "Usuario 2"
:email ""
:birthday "1975-09-11"}})
; pull stored user info from id
(pco/defresolver user-by-id [{:keys [acme.user/id]}]
{::pco/output
[:acme.user/name
:acme.user/email
:acme.user/birthday]}
(get users-db id))
so my code looks like
(def products {1 {:product/name "Moog Voyager XL"
:finance/price-in-cents 400000}
2 {:product/name "Roland V-Drum"
:finance/price-in-cents 40000}
3 {:product/name "RME UFX II"
:finance/price-in-cents 100000}
4 {:product/name "UAD Satellite Octo"
:finance/price-in-cents 100000}
5 {:product/name "Beer"
:finance/price-in-cents 300}})
(pco/defresolver product-id->product
[_ctx {:product/keys [id]}]
[{::pco/input [:product/id]
::pco/output [:product/name
:finance/price-in-cents]}]
(get products id))
but Im getting
Syntax error macroexpanding com.wsscode.pathom3.connect.operation/defresolver at (src/reify/main.clj:61:1).
{:name product-id->product, :arglist [[:sym _ctx] [:map #:product{:keys [id]}]], :body [[#:com.wsscode.pathom3.connect.operation{:input [:product/id], :output [:product/name :finance/price-in-cents]}] (get products id)]} - failed: (fn must-have-output-visible-map-or-options [{:keys [body options]}] (or (map? (last body)) options)) spec: :com.wsscode.pathom3.connect.operation/defresolver-args
this solves the error
(pco/defresolver product-id->product
[_ctx {:product/keys [id]}]
[{::pco/input [:product/id]
::pco/output [:product/name
:finance/price-in-cents]}]
{:product/name (get-in products [id :product/name])
:finance/price-in-cents (get-in products [id :finance/price-in-cents])})
but its a bit smelly, am I missing something?