@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
great, thanks
@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
@thomasmoerman sent a comment there
@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?
@wilkerlucio I answered with an example that triggers the problem
hello, I tried with to many with this:
(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]}}]}])))
it still worked, Im wondering what is triggering the error validation (I'm using with guardrails on here too, but not triggering the error)
thanks, I’ll have a look on it tomorrow