pathom

:pathom: https://github.com/wilkerlucio/pathom/ & https://pathom3.wsscode.com & https://roamresearch.com/#/app/wsscode
Thomas Moerman 2020-10-18T21:12:47.125Z

@wilkerlucio I added a comment to this (closed) issue, I have the impression that union queries for the parallel parser are still broken, or i'm doing something wrong: https://github.com/wilkerlucio/pathom/issues/160

Thomas Moerman 2020-10-19T09:25:35.126700Z

great, thanks

yenda 2020-10-19T10:12:58.126900Z

@wilkerlucio also related, when trying to use join-seq in a resolver for a union query, I have to use a weird workaround: https://clojurians.slack.com/archives/C87NB2CFN/p1602448785082500

wilkerlucio 2020-10-19T18:56:16.127300Z

@thomasmoerman sent a comment there

wilkerlucio 2020-10-19T18:58:41.127600Z

@yenda I understand this a pain at the moment, one idea I have to go around is to make a ::p/union-path that is smarter and can do both (the default and yours, depending on the context), you can use information from env to decide the context, maybe you change depending on the ::p/path, makes sense?

Thomas Moerman 2020-10-19T19:20:14.127900Z

@wilkerlucio I answered with an example that triggers the problem

wilkerlucio 2020-10-19T19:24:02.128100Z

hello, I tried with to many with this:

wilkerlucio 2020-10-19T19:24:04.128300Z

(pc/defresolver input-group=>cases-union
  [_ {:nexus.project/keys     [historic-cases]
      :nexus.input-group/keys [id] :as input}]
  {::pc/docstring "Resolve Cases by InputGroup, union query."
   ::pc/input     #{:nexus.input-group/id
                    :nexus.project/historic-cases}
   ::pc/output    [{:nexus.input-group/cases-union [:nexus.case.image-annotation/id
                                                    :nexus.case.test-case/id]}]}
  {:nexus.input-group/cases-union [{:nexus.case.image-annotation/id 1}
                                   {:nexus.case.test-case/id 1}]})

(def debug-parser
  (p/parallel-parser
    {::p/env     {::p/reader               [p/map-reader
                                            pc/parallel-reader
                                            pc/open-ident-reader
                                            p/env-placeholder-reader]
                  ::p/placeholder-prefixes #{">"}}
     ::p/mutate  pc/mutate-async
     ::p/plugins [(pc/connect-plugin {::pc/register [input-group=>cases-union
                                                     (pc/constantly-resolver :nexus.project/historic-cases "foo")]})
                  p/error-handler-plugin
                  p/trace-plugin]}))

(comment
  (async/<!! (debug-parser {}
     [{[:nexus.input-group/id 1]
       [{:nexus.input-group/cases-union {:nexus.case.image-annotation/id [:nexus.case.image-annotation/id
                                                                          :cmmn.case/id
                                                                          :cmmn.case/name]
                                         :nexus.case.test-case/id        [:nexus.case.test-case/id
                                                                          :cmmn.case/id
                                                                          :cmmn.case/name]}}]}])))

wilkerlucio 2020-10-19T19:24:31.128500Z

it still worked, Im wondering what is triggering the error validation (I'm using with guardrails on here too, but not triggering the error)

wilkerlucio 2020-10-18T23:12:09.126100Z

thanks, I’ll have a look on it tomorrow