This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-19
Channels
- # announcements (15)
- # babashka (4)
- # beginners (55)
- # calva (92)
- # cider (70)
- # circleci (1)
- # clj-kondo (136)
- # cljdoc (2)
- # clojars (11)
- # clojure (48)
- # clojure-australia (1)
- # clojure-europe (30)
- # clojure-nl (3)
- # clojure-sweden (2)
- # clojure-uk (7)
- # clojurescript (40)
- # conjure (5)
- # core-async (11)
- # cursive (55)
- # data-science (1)
- # datomic (10)
- # degree9 (2)
- # development-containers (15)
- # events (1)
- # fulcro (14)
- # gratitude (13)
- # helix (5)
- # lsp (35)
- # malli (10)
- # meander (18)
- # off-topic (24)
- # pathom (13)
- # polylith (12)
- # practicalli (6)
- # re-frame (13)
- # reagent (33)
- # reitit (4)
- # remote-jobs (1)
- # shadow-cljs (13)
- # spacemacs (31)
- # specter (1)
- # stepwise (2)
- # tools-deps (19)
- # vim (1)
- # xtdb (7)
greetings, i'm reading the wonderful written documentation for pathom3 and evaling some examples in my editor and i seem to have hit a snag.
https://pathom3.wsscode.com/docs/resolvers/#parameters
talks about (pf.eql/process env [::todos])
And i'm told that alias is this: [com.wsscode.pathom3.format.eql :as pf.eql]
However i can't seem to find that function. I'm on the latest commit 6e8fa2
is it supposed to be one of the other eql namespaces?
just p.eql/process maybe?
that seems to do the trick.
if someone can point out where i should submit documentation changes ill be happy to note it there 🙂
sorry, I see that too late, but at the end of all documentation pages there is a link to "Edit this page", you can use that to send edits
fix commit for the pf.eql
: https://github.com/wilkerlucio/pathom3-docs/commit/c7b694b29a5739884ce1300993a0acb6d7bfcb15
hello, @drewverlee ups, that example is wrong, it should be p.eql/process
, from com.wsscode.pathom3.interfaces.eql
going to fix that now
So this mock example works the way i would hope
(def mock-todos-db
[{::todo-message "Write demo on params"
::todo-done? true}
{::todo-message "Pathom in Rust"
::todo-done? false}])
(pco/defresolver todos-resolver [env _]
{::pco/output
[{::todos
[::todo-message
::todo-done?]}]}
{::todos
;; pull params and filter
(if-some [letter (get (pco/params env) ::letter)]
(->> mock-todos-db
(filter #(str/includes? (::todo-message %) letter)))
mock-todos-db)})
(def env (pci/register todos-resolver))
(def sm2 (psm/smart-map env {}))
(p.eql/process env
'[(::todos {::letter "x"})])
But it doesn't work for a more complex example because I don't now how to structure the eql correctly I suppose.
Some simple questions:
1. where would i read more about the syntax for [(::todos {::letter "x"})]
E.g i assume ::todos patches to the defresolver top level map key, this is EQL?
2. what does the :>
syntax mean?
3. Is pco output always a vector? Is that to allow for multiple root/maps?
I'm reading the docs know. I'll try to answer my own simple questions as I have time ;).no worries 1. you can read about the syntax at: https://edn-query-language.org/eql/1.0.0/specification.html#_parameters 2. Placeholders: https://pathom3.wsscode.com/docs/placeholders 3. yes, always a vector, a EQL more specifically, and the resolver output is always a map (*both things change in case of batch resolvers)
can you give more details about the more complex example you are trying?
ps: on your demo, better use filterv
, lazy sequences may cause strange trace behavior (due due to when the item collections get evaluated)