Fork me on GitHub
#pathom
<
2022-07-20
>
λustin f(n)19:07:53

In Pathom 3, is there a reason why I would be able to write a nested query, but when I write a resolver that requires the same nesting structure that resolver gets a :com.wsscode.pathom3.error/attribute-unreachable error? Query:

[{:sf.resources/by-product-id
  [{:sf/resource [:resource/meta]}]}
 :resource.meta/category-set]
Heading data for the resolver that fails
(pco/defresolver resource-category-set
  [_ {resources  :sf.resources/by-product-id}]
  {::pco/input  [{:sf.resources/by-product-id
                  [{:sf/resource
                    [:resource/meta]}]}]
   ::pco/output [:resource.meta/category-set]})

λustin f(n)19:07:19

:sf.resources/by-product-id doesn't directly provide :resource/meta , it instead goes through a few resolvers to get subfields. Would that be part of it?

roklenarcic10:07:45

Does querying just `

[{:sf.resources/by-product-id
  [{:sf/resource [:resource/meta]}]}]
work?

λustin f(n)20:07:38

Yes, that works

λustin f(n)23:07:38

Found it. I was nesting improperly in my resolver. I think the query itself had enough info to handle my improper nested query and still return something 'sane', but the resolver choked on the incorrect nesting.