Fork me on GitHub
#pathom
<
2021-01-04
>
Christopher Genovese01:01:35

I've got a pathom resolver (in a Fulcro RAD app) that takes has empty :input and :output that looks like

[{:widget/all-widgets [:widget/id :widget/title :widget/description]}]
My resolver returns data that appears to be a valid tree, of the form
{:widget/all-widgets [{:widget/id "foo" :widget/title "bar" :widget/description "zap"}
                      {:widget/id "goo" :widget/title "car" :widget/description "aap"}
                      ...]}
But the response to the query is empty {} for reasons that are unclear to me. Is there some apparent pathom-based problem with this that might be causing the parse to fail? Thanks!

jmayaalv08:01:58

@genovese are you sure the resolver is not throwing an error? maybe if you could show the code it would be easier to see what’s going on.

Christopher Genovese02:01:03

Thanks! Here's the resolver:

(defattr all-widgets :widget/all-widgets :ref
  {ao/target     :widget/id
   ::pc/output  [{:widget/all-widgets [:widget/id :widget/a :widget/b]}]
   ::pc/resolve (fn [env _]
                  #?(:clj
                     (if-let [db (get-in env [::mongo/connections :rav :db])]
                       {:widget/all-widgets (mongo/get-widgets db)}
                       (log/error "Cannot find database for rav schema!"))))})

Christopher Genovese03:01:23

Here I used widget/a and widget/b for the title and description properties listed earlier.

dehli20:01:05

i’ve got this weird behavior where when i query [:a :b] i successfully have both keys returned, but when I query for [:b :a] I get one returned and the other is not found. What’s the best way to debug why this this could be happening? Edit: It looks like it’s something specific to reader3 b/c with async-reader2 i’m not seeing the issue