Fork me on GitHub
#pathom
<
2020-03-05
>
yenda13:03:32

is there a recommended pattern to fallback on a remote parser when a local parser didn't find all keys? should it be a mega resolver or a last reader?

wilkerlucio13:03:10

@yenda that's whats coming on the next version 🙂 I have two projects using a setup in the way you described, they have both local parsers (running on CLJS) and remote parsers (running on some server), for basic cases it already works, but I still have to document a lot of it, and I'm still working on some tooling, so until I have docs and tools I dont recommend it for general usage. but if you are feeling adventurous, there are examples in the tests: https://github.com/wilkerlucio/pathom/blob/query-planner/test/com/wsscode/pathom/connect/planner_readers_test.cljc#L328-L562 (use the alpha releases to have it available)

wilkerlucio13:03:29

I also like to improve the visibility of the work I'm doing, because that's been a quite long work process to get this out, and I like to provide something so people that want to follow can know whats going on, not going deep on this now, but expect some news around that soon 🙂

parrot 4
yenda13:03:05

@wilkerlucio that look awesome! In my case I have a pretty simple use case because I only have one remote and I know that whatever isn't solved locally will be solved remotely, so I was basically looking for a solution to send the remainers of the query that have not been solved to the remote

yenda13:03:57

but maybe it isn't that simple, I was hoping there would be a way to get the remaining query after the local parser ran and just send it to the remote parser

wilkerlucio13:03:05

this can be done with some map manipulation code, get the query, query the data, make a diff and run, I guess its a simpler problem

yenda13:03:27

and were would you do that? in a custom reader?

wilkerlucio13:03:12

depends on the case, are you doing it in a fulcro app?

yenda13:03:38

no re-frame

yenda13:03:02

I run the local parser on app-db

yenda13:03:19

I'd like to know what is the best place to rebuild a query based on all the ::p/not-found in the result of the local parser

yenda13:03:29

maybe just work it out from the result of the local parser and the initial query

yenda13:03:47

as a first step I could just re-run the whole query, I'd just need a way to know if the response is incomplete without looking at it