Fork me on GitHub
#pathom
<
2022-11-25
>
pfeodrippe05:11:37

[RESOLVED] Hi o/ I am trying to see which attributes a node is trying to resolve, I've thought that I could rely on ::pcp/source-for-attrs which is used at https://github.com/wilkerlucio/pathom3/blob/main/src/main/com/wsscode/pathom3/connect/runner/stats.cljc#L72, but I don't see it in my run-stats response for a query (see below for an example). Is this expected? Maybe is there another way to see the current attribute a node is trying to resolve?

{... ...

 :com.wsscode.pathom3.connect.planner/nodes
 {20
  {:com.wsscode.pathom3.connect.operation/op-name my.resolver/a->b
   :com.wsscode.pathom3.connect.planner/expects #:db-my.person{:id {}}
   :com.wsscode.pathom3.connect.planner/input #:my.person{:external-id {}}
   :com.wsscode.pathom3.connect.planner/node-id 20
   :com.wsscode.pathom3.connect.planner/node-parents #{21}
   :com.wsscode.pathom3.connect.planner/run-next 16},

  ... ...}}

Eric Dvorsak13:11:37

the attributes a node is trying to resolve are in :com.wsscode.pathom3.connect.planner/expects so in your case #:db-my.person{:id {}}

❤️ 1
pfeodrippe13:11:58

Hunnnn, I’ve thought this was the return of the resolver, but you are right, Eric! Thanks :D Wonder if source-for-attrs is really used anymore