pathom

:pathom: https://github.com/wilkerlucio/pathom/ & https://pathom3.wsscode.com & https://roamresearch.com/#/app/wsscode
ak-coram 2020-07-27T09:10:42.361300Z

one of my resolvers always gets called twice with the same input, are there any common mistakes that can lead to this?

yenda 2020-07-27T13:11:33.362500Z

is there a way to not return keys instead of pathom-not-found? or at least nil so that booleans don't end up being truthy?

yenda 2020-07-27T13:12:34.362600Z

it's normal if you are doing a parallel parser and some fields are resolved in parallel withthe same input. For instance if you are resolving a list of comment and the user associated with each comment while the user commented more than once

souenzzo 2020-07-27T13:39:05.363Z

@yenda there is a p/elide-special-outputs-plugin plugin 😉

yenda 2020-07-27T13:41:51.363200Z

what does it do exactly?

souenzzo 2020-07-27T13:47:49.363600Z

Something like it

(letfn [(elide-special
          [el]
          (cond
            (map? el) (into {}
                            (keep (fn [[k v]]
                                    (when-not (contains? #{::p/not-found
                                                           ::p/error}
                                                         v)
                                      [k (elide-special v)])))
                            el)
            (coll? el) (mapv elide-special el)
            :else el))]
  (let [result (<! (parser env tx))]
    (elide-special result)))