pathom

:pathom: https://github.com/wilkerlucio/pathom/ & https://pathom3.wsscode.com & https://roamresearch.com/#/app/wsscode
wilkerlucio 2020-10-09T13:50:20.068500Z

hello @markaddleman, doing decomposition resolvers is fine if you wanna give a "name" to a composite structure, one example case that I find interesting to do it is for leiningen style deps, breaking something like :library/path [org.clojure/core.async "1.3.610"] to the attributes :library/symbol :library/version, so this is a legit usage. In your case I see that the composed structure already has all the keys, so you can instead using something like:

wilkerlucio 2020-10-09T13:51:17.069100Z

[{([:portfolio/id 123] {:pathom/context {:application/app-key "..."}})}]

wilkerlucio 2020-10-09T13:52:28.070700Z

another suggestions from what I'm seeing in your code: 1. I see some unqualified keywords, I strongly recommend to avoid those, they may clash with other names too easely 2. try to think more flat, I see nestings like :portfolio/id {:portfolioKey "Z8X06QFpRXiu7BCyBg2xOg"}, I suggest to avoid those wrappings and just make long attributes that have context-free meaning

1
wilkerlucio 2020-10-09T13:52:58.071300Z

a common approach is at the edges (when you are hitting some actual service or database), make an adapter and convert any unqualified name to fully qualified ones

markaddleman 2020-10-09T14:29:17.073400Z

Thanks. The point of wrapping :portfolioKey with :portfolio/id was to avoid clashing and remain compatible with the backend. I hadn't thought of stripping the namespaces. Good point!