Hi. I'm finally picking this back up and it turns out the repro case is very simple:
(pco/defresolver data-source-event-attributes []
{::pco/input []
::pco/output [:out]})
(def env (-> (pci/register [data-source-event-attributes])
(p.plugin/register (pbip/attribute-errors-plugin))))
(comment
(p.eql/process env [{'(:>/GroupBys {}) [(pco/? :out)]}]))
The query produces an attribute error. I don't think it shouldquerying optional items in eql/process isnt a thing
they only work in resolvers, not in eql process
Oh š I have a resolver that does this query on its input. I figured I was simplifying by moving it to the client query
I'll keep trying to find a small repro case
and just to clear it up, they are not a thing there because there is no dependency on top of that, so if its not there, it just an edge thing, but maybe it could have some value in the sense of validation, not a thing at this moment, but if you believe this is a useful case please open a discussion on pathom 3 repo and we can keep that in mind
I just got a minimal case. I'll open a discussion on github
actually, my repro case may have found something different. I have a case where pathom cannot generate a plan where I think it should
Putting into github
Pathom 2.3.1. Is there a way to return nil
in a field in a resolver instead of ::p/not-found
? My google-fu is failing me
oh, I just see there is p/elide-not-found
that does it already
there is a plugin that can help you there:
(def parser
(p/parser {::p/plugins [;; add this one at the end of your plugins
p/elide-special-outputs-plugin]}))
1šand nothing wrong with your google-fu, just not well documented
1šIām not looking to replace every instance of not found, just the ones I know are nil.
Would writing a plugin that replaces something like ::p/nil
with nil on output be a reasonable solution?
if you look into the p/elide-special-outputs-plugin
, you can copy and modify it
(def elide-special-outputs-plugin
(post-process-parser-plugin elide-special-outputs))
(defn elide-special-outputs
"Convert all ::p/not-found values of maps to nil"
[input]
(elide-items special-outputs input))
(def special-outputs #{::reader-error ::not-found})
so, something like: (p/post-process-parser-plugin #(elide-items #{::p/not-found} %))
Oh I see! Thank you for the help š