Fork me on GitHub
#pathom
<
2021-11-30
>
Mark Wardle14:11:43

Hi all. I have started using batch resolvers but I am getting WARN messages in my logs. I have an optional relationship from an encounter to the form_edss (although not marked as optional) that will return nil if there is no corresponding form of that type for the encounter. Tue Nov 30 12:53:38 UTC 2021 WARN :com.wsscode.pathom3.connect.runner/event-batch-unsupported - {:com.wsscode.pathom3.path/path [pc4.rsdb/search-patient-by-pseudonym :t_patient/encounters 3], :com.wsscode.pathom3.connect.operation/op-name com.eldrix.pc4.server.rsdb/encounter->form_edss} From https://github.com/wardle/pc4/blob/49cdaee6031997c3bf1290de25f9df51cacaa4ed/pc4-server/src/com/eldrix/pc4/server/rsdb.clj#L514 : (pco/defresolver encounter->form_edss [{:com.eldrix.rsdb/keys [conn]} encounters] {::pco/input [:t_encounter/id] ::pco/output [{:t_encounter/form_edss [:t_form_edss/id :t_form_edss/edss :t_form_edss/edss_score :t_form_edss_fs/id :t_form_edss_fs/edss_score]}] ::pco/batch? true} (map #(when-not (every? nil? (vals %)) (hash-map :t_encounter/form_edss %)) (forms/encounters->form_edss conn encounters))) Can I safely ignore these warnings, as the results see right to me on testing?

wilkerlucio14:11:13

hello, you shouldn't ignore those 🙂 batch requires that the path to access the data is "randomly accessible", this means the path from the the root to the entity needs random access all the all, mas have that, vectors have that, but other types of lists and sets don't so you should check if all collections in the path for your batch are vectors ,otherwise pathom isn't actually batching, just running one by one

Mark Wardle14:11:33

Got it. Thanks Wilker!