Fork me on GitHub
Drew Verlee21:08:42

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. 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

Drew Verlee22:08:39

is it supposed to be one of the other eql namespaces?

Drew Verlee22:08:31

just p.eql/process maybe?

Drew Verlee22:08:31

that seems to do the trick.

Drew Verlee22:08:57

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


hello, @drewverlee ups, that example is wrong, it should be p.eql/process, from com.wsscode.pathom3.interfaces.eql


going to fix that now

Drew Verlee23:08:06

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 _]

   ;; pull params and filter
   (if-some [letter (get (pco/params env) ::letter)]
     (->> mock-todos-db
          (filter #(str/includes? (::todo-message %) letter)))

(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: 2. 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)