Fork me on GitHub
#pathom
<
2019-04-29
>
kszabo14:04:43

are there any plans to support global resolver resolution in Connect mutations? I would love the automatically get :current-user/name for logging purposes, and I already wrote a resolver for it

kszabo15:04:29

If ::pc/input would work as with plain resolvers, it would be great

souenzzo15:04:16

i think that resolvers should receive something like ::pc/query

kszabo15:04:35

{::pc/input  [:utc-time/now :current-user/email]
 ::pc/params [:arg1 :arg2]
 ::pc/output [:model/id]}

kszabo15:04:44

this reads nicely to me

kszabo15:04:38

it would also signal that this has the same semantics as a resolver input

wilkerlucio18:04:21

@thenonameguy what you mean supports global resolution? if you jsut want to run a subquery, you can call the parser from the inside, something like:

wilkerlucio18:04:37

(pc/defmutation do-thing [{:keys [parser] :as env} _]
  {::pc/sym 'user/do-thing}
  (let [user-name (parser env [:current-user/name])]
    ...))

wilkerlucio18:04:54

(remember to read the channel in case you are using async or parallel parsers)

wilkerlucio18:04:15

@souenzzo what data you would like available as ::pc/query?