Fork me on GitHub
#pathom
<
2019-10-18
>
souenzzo12:10:42

Hey I'm developing a application dashboard, and trying to keep api-url as a "first class" My query start with [{[:app/api-url "..."] [{:app/things [:thing/id :thing/stuff]}]}] My first resolver do ::pc/input #{:app/api-url} ::pc/output [{:app/things [:thing/id]}] Then it should call ::pc/input #{:app/api-url :thing/id} ::pc/output [:thing/stuff] But there is no api-url in {:thing/id ..} input There is some helper to "foward" some attributes?

wilkerlucio14:10:20

@souenzzo this looks more like an environmet data, do you see :app/api-url is an actual entity in your system, or this just data you need to flow down?

souenzzo14:10:51

I'm not sure ๐Ÿ˜… I started using it as a environment, associated with the browser session, but then I think "that if I want show a list of things where there is things from 2 instances?"

souenzzo17:10:03

Im trying to implement a plugin/reader that keep some keys in the new contexts

wilkerlucio18:10:47

its ok, but still feels like this should be something you set on the environment, it naturally flows down, and you can change it in the middle of queries using ::p/env on the return of some data if you need to

๐Ÿ‘ 4
wilkerlucio18:10:53

we do something similar like that at nubank to deal with shards

souenzzo19:10:37

this p/env should exists by defaul?

wilkerlucio20:10:42

the ::p/env thing may be missing docs (sorry), but in a gist, you do something like this in your resolver return value: {:some/data 123 :deep/info {:more/data "meh" ::p/env (assoc env :app/api-url "new-url")}}

wilkerlucio20:10:57

now when it gets to process :deep/info, env will be changed, makes sense?

cjsauer23:10:47

Can a parser reflect on itself? As in can I query for things like resolvers, output keys, etc?

cjsauer23:10:03

I imagine the viz uses something like this, but I canโ€™t quite grasp the gist of it