Fork me on GitHub

@tony.kay Thanks for all the help today! I have a question about resolvers —  1. Resolver (a) is the :story/all-stories resolver — I’m attempting to indicate in pc-output that I’m passing back not just :story/id, but also :story/author and :story/title Does Fulcro / Pathom understand that those attributes are in the response, and it doesn’t need to fetch those again? 2. If resolver (b) is cheaper than resolver (c), and given that there are 8K records, can Fulco / Pathom detect when use (b) instead of (c), if I’m not asking for story/content? (I’m finding that this query below uses Resolver (c), even though I’m not asking for :story/content.)

   [:story/id :story/title]}]


1. Yes 2. More advanced should probably concern yourself more with batch mode, but these are more #pathom questions


The short answer is pathom in your case will start with (a), because it has to. If some of the things are resolved and returned by that resolver, then it will only go looking for the remainder. Of course (b) has to be used if you want the title/author, because you've not told it anywhere else to get that from, and (c) would have to be used to get content; however, if either of those returns things it didn't advertise, then pathom won't need to call the other. The reason I say batch is more important is that if you have 1000 stories and no batch more enabled, these resolvers are going to get called 1000 times instead of just once.


You're better off having a single resolver that looks at the incoming query in evn and adapts the database query to the requirements of the request. That way, with batch enabled, you can get exactly the details required with possibly jsut one query


So cool! And so much fun! Thank you!!


@U066U8JQJ I’m looking in the Pathom documentation on how to retrieve the desired output vector from the env — can you give me any hints on where to find it? Thank you! (I see (:ast env) gets me {:type :prop, :dispatch-key :story/title, :key :story/title}, but that’s obviously not it.) (I’m trying to detect when the query is requesting the :story/content attribute, which is the “expensive” part of the query.).


@U6VPZS1EK you can use ::p/parent-query from env, that will have the sibling attributes, its rudimentar but you can try to find the attribute there


the way its rudimentar is that you will only be able to see if it its a explicity dependency (meaning the end-user requested it)


Ooh! There it is! Thank you!!!


but there could be a case that a resolver needs that information, but the user doesn't request it, in this case, if you are using this as a way to "don't query the expensive thing", you may end up in a situation where it is required, but you didn't got it


this is a fixed problem in Pathom 3 btw, there you can see precisely everything required, explicit or implicit


Wilker, I think this is exactly what I need to compose the actual “database query” (which is actually just an EDN file loaded into the server.) Just curious: where should I have found this in the docs? Or is this not something you expect people to do?


Pathom 2 docs are kinda lacky, this is the kind of thing you can find asking us or readying sources. logging the whole env is a nice way to explore for sure


trying to do a better job about those in Pathom 3 😅


logging the keys of the env. 😄 Logging the env is madness


in the server console I agree, but if using the browser, or something like Reveal, then its nice


yeah, tapping the env is nice


@U6VPZS1EK what you using to see the data in the screenshot you sent?


That’s from Portal — I’ve tried REBL, then Reveal, and then Portal. I really like it, and there’s something nice about it running in a browser, versus JavaFX.


(Small things like copy/paste always acting like you’d expect.)


I literally just added Portal to my Fulcro RAD development.clj file this morning. Took less than 2m to add, from opening deps.edn to getting tap> displayed!


(Called it a night when I logged entire env going into defresolver, wondering where parser query was. 🙂 My reaction was, “Whoa. Maybe I’ll have more clarity tomorrow” 🙂 😆


Like @tony.kay said, my reaction was, “searching through that might lead to madness, especially at 1am.” 🙂


cool, I'll give portal a try


I like reveal but dealing with JavaFX when I want to extend it is quite painful


@tony.kay @U066U8JQJ Thanks for help on Pathom query stuff — finally got render time for displaying a specific RSS story down to.. nearly instantaneous! Down from 3/4 of a second. 🙂 🎉 (PS: Let me know how Portal goes! It’s what finally got me to start using on all projects.)