pathom

roklenarcic 2026-01-23T12:04:55.392519Z

I’ve tried to add a property (key-value) to my resolver (I can see it in its map). Now I am trying to enact a policy based on that property on my resolvers via a plugin. I have tried a `

:com.wsscode.pathom3.connect.runner/wrap-resolve
plugin, but in that plugin, I cannot find in env map data about the resolver to check this flag. How could I do something like this

roklenarcic 2026-01-25T09:21:59.286829Z

Thanks

wilkerlucio 2026-01-24T12:18:42.772939Z

hi @roklenarcic, here is an example on how to get the resolver config in that context:

wilkerlucio 2026-01-24T12:18:44.972959Z

(ns pathom3.demos.wrap-resolver-options
  (:require [com.wsscode.pathom3.connect.indexes :as pci]
            [com.wsscode.pathom3.connect.operation :as pco]
            [com.wsscode.pathom3.interface.eql :as p.eql]
            [com.wsscode.pathom3.plugin :as p.plugin]))

(pco/defresolver my-resolver []
  {:my/custom-config "something"}
  {:ran true})

(p.plugin/defplugin my-plugin
  {:com.wsscode.pathom3.connect.runner/wrap-resolve
   (fn [resolve]
     (fn [env input]
       (let [op-name         (-> env :com.wsscode.pathom3.connect.planner/node ::pco/op-name)
             resolver-config (-> env ::pci/index-resolvers op-name pco/operation-config)]
         (println "RESOLVER CUSTOM CONFIG" (:my/custom-config resolver-config))
         (resolve env input))))})

(def env
  (-> {}
      (pci/register my-resolver)
      (p.plugin/register my-plugin)))

(comment
  (p.eql/process env [:ran]))

wilkerlucio 2026-01-24T12:43:01.251359Z

also started a new Cookbook section in Pathom 3 docs where I plan to include more specific examples like this: https://pathom3.wsscode.com/docs/cookbook/using-resolver-configuration-with-wrap-resolve

🆒 1
❤️ 11