Fork me on GitHub
#pathom
<
2021-06-09
>
markaddleman14:06:51

I have a resolver that takes a few required attributes and an optional attribute. In a particular query, the optional attribute cannot be computed by its resolver. My environment contains the attribute-errors-plugin. I see that the attribute-errors-plugin reports an "Insufficient data" for the optional node/attribute.

markaddleman14:06:01

A few questions: Is this intended behavior? If so, I'd like to understand the rationale. If this is not intended behavior, I'll produce a minimal test case

markaddleman14:06:09

Oh, one more thing: The optional attribute is declared within pco/input as

{(pco/? :data-source.event/attributes) [:data-source.event.attribute/id
                                                           :data-source.event.attribute/friendlyName
                                                           :ui.attribute.selector/heading]}
I think that's the right syntax

wilkerlucio15:06:59

@markaddleman can you send a full example? may be a bug

markaddleman15:06:01

I can easily send a the exception that attribute-errors plugin reports. Creating a minimal test case is possible, of course, but it will take me a day or two

wilkerlucio15:06:12

just a minimal repro so I can see what you see

👍 2
markaddleman14:06:28

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 should

wilkerlucio15:06:23

querying optional items in eql/process isnt a thing

wilkerlucio15:06:37

they only work in resolvers, not in eql process

markaddleman16:06:58

Oh 😕 I have a resolver that does this query on its input. I figured I was simplifying by moving it to the client query

markaddleman16:06:05

I'll keep trying to find a small repro case

wilkerlucio19:06:27

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

markaddleman19:06:11

I just got a minimal case. I'll open a discussion on github

markaddleman19:06:03

actually, my repro case may have found something different. I have a case where pathom cannot generate a plan where I think it should

markaddleman19:06:07

Putting into github