Fork me on GitHub

@wilkerlucio if you have a minute sometime can you keep me honest here please?;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: 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?


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


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