Fork me on GitHub
#pathom
<
2019-05-28
>
daniel.spaniel22:05:42

I have a basic pathom 101 question that has me puzzled. Let's say I have an entity called 'thing' and I want to query for attributes of thing like thing/name and thing/age .. and usually pathom lets you pass in the query and that works fine BUT if the attributes are not in the pc/output then the query params are not used, so it seems like I have to list all the thing attributes in the pc/output value ?? is that true ? am I missing something .. so here is my resolver

daniel.spaniel22:05:49

(defresolver thing-resolver
  "Resolves query for a thing"
  [{:keys [conn] :as env} {:keys [thing/id] :as input}]
  {::pc/input  #{:thing/id}
   ::pc/output [:db/id :thing/id]}
  (d/pull (d/db conn) (::core/parent-query env) [:thing/id id]))

daniel.spaniel22:05:25

and if I query for thing/name and or thing/age they will not be returned since they are not declared in the ::pc/output

daniel.spaniel22:05:41

this seems odd, but maybe that is the way it is ?