Open souenzzo opened 4 years ago
in here https://github.com/wilkerlucio/pathom/blob/master/src/com/wsscode/pathom/connect.cljc#L1508 and https://github.com/wilkerlucio/pathom/blob/master/src/com/wsscode/pathom/connect.cljc#L1530
(if-let [{::keys [sym] :as mutation-data} (get-in indexes [::index-mutations sym'])]
(let [env (-> env
(assoc-in [:ast :key] sym)
(assoc ::pc/mutation-data mutation-data))]
Consider mutation-data
helper function (line 124 ATM)
test
(is (every? number? (for [[mutate parser-gen] [[pc/mutate p/parser]
[pc/mutate-async p/parallel-parser]]]
(let [register [(pc/mutation `mutation
{::my-var 42}
(fn [env params]
{::mutation (-> env ::pc/mutation-data))}))]
parser (parser-gen {::p/plugins [(pc/connect-plugin {::pc/register register})]
::p/mutate mutate})]
(-> (parser {} `[(mutation)])
(wasync/<!!maybe)
(get-in [`mutation ::mutation ::my-var]))))))
In
resolver
context, pathom provide apc/resolver-data
that contains all "metadata" from resolverThis feature isn't present in mutation.