pathom

:pathom: https://github.com/wilkerlucio/pathom/ & https://pathom3.wsscode.com & https://roamresearch.com/#/app/wsscode
markaddleman 2021-06-09T14:17:51.066600Z

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.

markaddleman 2021-06-09T14:19:01.067900Z

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

markaddleman 2021-06-09T14:20:09.068500Z

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

wilkerlucio 2021-06-09T15:13:59.069300Z

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

markaddleman 2021-06-17T14:36:28.097100Z

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

wilkerlucio 2021-06-17T15:49:23.097700Z

querying optional items in eql/process isnt a thing

wilkerlucio 2021-06-17T15:49:37.098300Z

they only work in resolvers, not in eql process

markaddleman 2021-06-17T16:36:58.098500Z

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

markaddleman 2021-06-17T16:37:05.098700Z

I'll keep trying to find a small repro case

wilkerlucio 2021-06-17T19:16:27.098900Z

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

markaddleman 2021-06-17T19:19:11.099100Z

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

markaddleman 2021-06-17T19:21:03.099300Z

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

markaddleman 2021-06-17T19:21:07.099500Z

Putting into github

markaddleman 2021-06-17T19:23:22.099700Z

https://github.com/wilkerlucio/pathom3/discussions/61

markaddleman 2021-06-18T12:51:39.104400Z

Thanks!

markaddleman 2021-06-09T15:15:01.069400Z

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

wilkerlucio 2021-06-09T15:18:12.069900Z

just a minimal repro so I can see what you see

👍 1