Fork me on GitHub
#pathom
<
2020-03-27
>
myguidingstar07:03:28

I guess this is a bug with the new planner or dynamic resolver https://gist.github.com/myguidingstar/53f2b552e2a5dca664b5df0d4780f8c7

wilkerlucio12:03:19

just in case, can you please try on the latest SHA on the query-planner branch? I've been doing some fixes this week.

wilkerlucio12:03:51

but Im not 100% on the current way the new planner handles placeholders, so reports like this are very welcome 🙏

myguidingstar16:03:36

@U066U8JQJ just tested on latest commit, the issue remains. Also, it's not about placeholders. It's in a normal branch. I tried to remove the placeholders, too.

wilkerlucio16:03:33

one thing I noticed, the resolvers you are adding with pc/add, they are just ending as regular resolvers, so they are not working as dynamic things, for them to be dynamic you need to point to the real dynamic resolver using ::pc/dynamic-sym, like foreign does

wilkerlucio16:03:49

also, be careful around that, the resolvers around dynamic, they do not work like regular resolvers

wilkerlucio16:03:21

they are aid resolvers to help the dynamic resolver figures itself, I surely have to document this better, but I myself need to play and figure them better too

wilkerlucio16:03:30

just keep in mind, they are different things with different expectations

myguidingstar17:03:16

@U066U8JQJ I only leveraged pc/add to build the indexes, after that I use mergeto override the resolver with :pc/dynamic-resolver? true

myguidingstar17:03:26

is that enough?

wilkerlucio17:03:04

what I'm pointing is not the dynamic resolver itself, but the "children resolver" of that dynamic resolver

wilkerlucio17:03:32

so, the resolvers that are intended to help a dynamic reoslver, they need to have a ::pc/dynamic-sym (different from ::pc/dynamic-resolver?) that points to the dynamic resolver

wilkerlucio17:03:52

its easy to imagine this in the foreign context, where all resolvers that are foreign (from a separated parser) should point to the dynamic resolver that calls that parser

wilkerlucio17:03:28

they are used to decide how to call the foreign, but they are never part of the execution graph themselves, and to pathom understand that they need to point to the dynamic resolver they are assisting, makes sense?

myguidingstar17:03:52

let me see, still trying to process 😉

myguidingstar17:03:57

why don't I see this dynamic-sym`` thing in pathom-datomic?

wilkerlucio17:03:43

because the datomic is simple enough it doesnt need one, datomic is just too regular 🙂

wilkerlucio17:03:01

if you see, the datomic only has the dynamic resolver, it doesn't have any "assistent resolvers"

wilkerlucio17:03:08

graphql will require some

myguidingstar17:03:09

what are the input and output of an assistant resolver?

myguidingstar17:03:24

I still don't see why (and where) I should add dynamic-sym to the gist link (it's basically me mimicking pathom-datomic, but too lazy to type the indexes so I use p/add)

wilkerlucio18:03:33

so, seems like you are trying to ray-trace how to make it work, which will be dificult IMO, the pathom-datomic is the simplest dynamic resolver that I can imagine, because datomic is very consistent across relationships (any entity can use any property of the schema, very consistent)

wilkerlucio18:03:39

in your case, its not going to be so much

wilkerlucio18:03:51

the need for assistent resolvers is so pathom can understand how to compute nested queries to send to the dynamic resolver (reducing number of calls), because of the nature of deep queries, this defintion can't be done in a single place, and may require multiple passes to figure what to send, that's were the assistent resolvers come, they serve as instructions of what is available at some specific context for that dynamic resolver

wilkerlucio18:03:09

that said, I didn't made any other implementation on this expect for the foreign-parser thing

wilkerlucio18:03:25

the way to use this for other types of dynamic resolvers is unclear at this point

wilkerlucio18:03:07

I hope to get more docs around that in the next month, but right now I'm focusing on tooling and more on the user side of the story (not the extension side for developers of dynamic resolvers, yet)

wilkerlucio18:03:34

sorry its so confusing, its just you are a very early adopter of something that still work in progress 😛

wilkerlucio18:03:41

I believe this will be more figure out when I sit and stop to do the new GraphQL integration, that's the one closest to what you are trying to do

myguidingstar18:03:06

well, I guess I did it wrong when I tried to port walkable to planner/dynamic by mimicking datomic. It's working now, but I think the resolver is doing too much right now. I guess some assistant should be extracted instead. I will try that

myguidingstar18:03:29

Thank you so much for all these nice things 😄

🙏 4