This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-05
Channels
- # announcements (2)
- # babashka (23)
- # beginners (67)
- # biff (4)
- # calva (19)
- # cider (6)
- # clj-kondo (40)
- # clj-yaml (14)
- # clojure (3)
- # clojure-austin (13)
- # clojure-europe (18)
- # clojure-nl (1)
- # clojure-norway (26)
- # clojure-uk (5)
- # clojurescript (42)
- # datascript (2)
- # datomic (6)
- # emacs (32)
- # graalvm (8)
- # humbleui (12)
- # hyperfiddle (13)
- # jobs (5)
- # lambdaisland (1)
- # lsp (18)
- # malli (15)
- # off-topic (20)
- # overtone (1)
- # pathom (5)
- # pedestal (15)
- # portal (3)
- # reitit (13)
- # releases (1)
- # remote-jobs (1)
- # yamlscript (4)
Howdy! I'm trying to use placeholders, but can't get them to work. I've tried the example from https://pathom3.wsscode.com/docs/placeholders, but it isn't working either. I'm not sure if I'm doing something wrong, or this is just broken (this is with com.wsscode/pathom3 {:mvn/version "2023.08.22-alpha"}
(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]}])
Results in:
Pathom can't find a path for the following elements in the query:
[:pathom-playground/full-name] at path [:>/bret]
{:com.wsscode.pathom3.connect.planner/graph
#:com.wsscode.pathom3.connect.planner{:nodes {},
:index-ast
#:pathom-playground{:full-name
{:type :prop,
:dispatch-key
:pathom-playground/full-name,
:key
:pathom-playground/full-name}},
:source-ast
{:type :join,
:dispatch-key :>/bret,
:key :>/bret,
:params
#:pathom-playground{:first-name "Bret",
:last-name
"Victor"},
:meta {:line 44, :column 6},
:query [:pathom-playground/full-name],
:children
[{:type :prop,
:dispatch-key
:pathom-playground/full-name,
:key :pathom-playground/full-name}]},
:available-data {},
:user-request-shape
#:pathom-playground{:full-name {}},
:unreachable-paths
#:pathom-playground{:full-name {},
:first-name {}}},
:com.wsscode.pathom3.connect.planner/unreachable-paths
#:pathom-playground{:full-name {}},
:com.wsscode.pathom3.path/path [:>/bret],
:com.wsscode.pathom3.error/phase :com.wsscode.pathom3.connect.planner/plan,
:com.wsscode.pathom3.error/cause
:com.wsscode.pathom3.error/attribute-unreachable}
I have to step away for the day, so no rush in getting back to me!Might be related to this breaking change: https://github.com/wilkerlucio/pathom3/pull/188 I’m not certain though. I just recall a breaking change with placeholders a while back
Thanks @U3XCG2GBZ! That is what I needed; I just needed to add the placeholder plugin:
(def env (p.plugin/register
(pci/register full-name)
(pbip/placeholder-data-params)))
I think the docs just need to be updated.thanks folks, I've updated the docs to reflect the change: https://pathom3.wsscode.com/docs/placeholders/#provide-data
Thanks @U066U8JQJ!