Fork me on GitHub

Hey all. Is there a way to enable hot code reloading of pathom resolvers and mutations? I have to keep restarting my repl to get changes to my resolvers to pick up :thinking_face:


@U7V6UECH1 you’d probably want to use some state management lib (like and reloaded workflow (via then you can reload the code and reinstantiate pathom instance with one function you can look at how it’s implemented here (no need to use fulcro itself)


eval the resolver and the parser again will get changes to show up. I am just experimenting with pathom in a single file to learn it and that is working for me


that’s a good approach for a simple setup as pathom per se doesn’t have a lifecycle semantics, but in general case there’s a http server and other stuff which depends on pathom and which needs to be properly reloaded when resolvers change

👍 4

I would recommend integrant: after using 4 years of mount


DI > globals


which mount promotes


@U08E8UGF7 i also used integrant on a few commercial projects, but one state map + multi-methods all over the place turned out to be somehow less manageable i’d really appreciate if you explained a bit more why you prefer integrant i might guess that’s in line with reasoning why people prefer data-driven vs macros like in the the shift from compojure to reitit i also see how integrant is more manageable in terms of testing, but still multi-methods


it’s exactly your points. Multi-methods is a necessary evil that I’m willing to take on. (I would prefer the data-driven pathom resolver approach if I would design it today). One benefit though with the ns-load side-effects that you can use the built-in load-namespaces function and name your components with keywords that have backing namespaces, then you can start your system map in your cli namespace without any knowledge where those multimethods reside. Essentially the system map can always initialize itself by deriving the implementation from it

👍 4

huh, seems like i’ve been doing a similar thing, but in a more hacky way and felt guilty for it, thanks! might be worth giving integrant another spin