Fork me on GitHub
#pathom
<
2022-10-06
>
Eric Dvorsak08:10:01

Is there a way in pathom to batch n+2 attributes? Eg I am exposing a db that has a table for an entity, and multiple tables for "subtypes" of that entity. I have a resolver that outputs {:entity-subtypeA [:subtypeA/id]} with :entity/id and :entity/subtype as inputs. So far so good pathom resolves all the attributes of subtypeA that I query. The problem is that when querying a list of entities, the resolver for subtypes is batched, but the subsequent calls for the attributes are not and one call is made for each entity

wilkerlucio12:10:29

in Pathom 3, it should batch also in the next level, as long as both resolvers support batching, it would be a two step batching, the first batch would get the items of the list, and the second a single batch for every sub-children

Eric Dvorsak12:10:12

sub children should be in a different batch depending on their type i'll see how pathom3 does it once I migrated, almost done with the pathom3 fulcro-rad-demo branch

wilkerlucio13:10:13

that's fine to be different batches, Pathom 3 does batching in a way that's very differnet from what Pathom 2 did, the Pathom 3 way is much more flexible

Eric Dvorsak13:10:05

nice! can't wait to see it working

Eric Dvorsak13:10:31

currently I'm struggling to get the db connection in the env with fulcro new-processor , seems like the example in fulcro-rad-demo doesn't work

Eric Dvorsak15:10:25

oh it's because I was trying the query in pathom viz and it does have the full context

Eric Dvorsak16:10:24

nice it is batching now

🙌 1
Eric Dvorsak18:10:07

I'm trying to figure out how to get pathom viz working, seems like it doesn't get the db in the env when using the new-processor https://github.com/fulcrologic/fulcro-rad-demo/compare/develop...pathom3#diff-d08b0b392ee3f4c4541e3539b449936f8c6835533f211df066764c5cda4e045aR27 I added the line (p.connector/connect-env {::pvc/parser-id `env}) directly here https://github.com/fulcrologic/fulcro-rad/blob/develop/src/main/com/fulcrologic/rad/pathom3.clj#L110

wilkerlucio21:10:58

given its a fulcro setup thing I think its better to ask about that on #C68M60S4F

wilkerlucio20:10:13

that's outdated, sorry about that

wilkerlucio20:10:28

I guess I copied over and oversight that

wilkerlucio20:10:30

I can fix in a bit