Fork me on GitHub
#pathom
<
2021-11-07
>
sheluchin18:11:35

@wilkerlucio if you have a minute sometime can you keep me honest here please? https://clojurians.slack.com/archives/C053AK3F9/p1636299859332600?thread_ts=1636204030.290000&amp;cid=C053AK3F9 Is this an accurate description of the approach you recommend with Pathom? I searched the docs for "qualified keys" and other variations thereof and only found a few small mentions. Are these ideas you mostly explore in the videos linked here: https://github.com/wilkerlucio/pathom/blob/b36c4c494493dc8819b6a89f977306c57d3840d1/README.md#see-a-talks-on-the-concepts or am I reaching in this description?

Nikolas Pafitis20:11:52

Hello guys, I just started playing around with pathom3 after watching the london clojurians talk. I got a question, how does a resolver that returns a collection of data look like? Is it a resolver that returns a map with a single kv pair and the value's the collection basically?

souenzzo12:11:30

Yes. Every "value" in pathom should be "named" "named" values can be requested by a query. If you write a resolver that returns a collection directly, how would the query be?! For example:

;; just a example. It do not work.
(defresolver my-coll [env input]
  [1 2 3])
Which query you need to run to get [1 2 3] back?! It can't fit in the model. To solve this, we always return the value with a keyword
(defresolver my-coll [env input]
  {:my-coll [1 2 3]})
Now you can request this value with the query [:my-coll] and it will return {:my-coll [1 2 3]}

wilkerlucio22:11:50

Also its common that the items of collection are also maps, so they enable further processing using sub queries