This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-07
Channels
- # announcements (2)
- # asami (2)
- # babashka (15)
- # babashka-sci-dev (31)
- # beginners (130)
- # boot (4)
- # cider (5)
- # circleci (12)
- # clj-kondo (10)
- # cljs-dev (8)
- # clojure (7)
- # clojure-czech (14)
- # clojure-europe (19)
- # clojure-france (5)
- # clojure-uk (2)
- # clojured (23)
- # clojurescript (11)
- # conjure (8)
- # datomic (5)
- # emacs (1)
- # etaoin (8)
- # events (2)
- # fulcro (10)
- # graalvm (18)
- # gratitude (1)
- # holy-lambda (16)
- # honeysql (4)
- # introduce-yourself (1)
- # jobs (2)
- # kaocha (3)
- # london-clojurians (1)
- # lsp (53)
- # off-topic (16)
- # other-languages (2)
- # pathom (4)
- # pedestal (3)
- # podcasts-discuss (1)
- # portal (10)
- # re-frame (69)
- # reitit (2)
- # shadow-cljs (11)
- # vim (7)
- # xtdb (29)
How do you handle attributes that kinda require a context to be resolved?
For instance let’s say you’ve got:
[:folder/id :folder/name :folder/path {:folder/files [:file/id :file/name :file/full-path]}]
Here the resolver for full-path would want to have folder/path and file/name but at that point only file/name is available. Now obviously you could generate full-path when resolving folder/files, but let’s say that you want to have a separate resolver for it. That takes folder/path and file/name.
You could have a full-path-resolver
that specifies its input to be a nested value with all the required data, like ::pco/input [:folder/path {:folder/files [:file/name]}]
, and pull the necessary data out of the input to form your :file/full-path
output.
as a general guide, you can never look up, only down, so in this specific case I think would be better to use the full path as the primary thing, since its trivial to compute the base name from it
that or, each level going down needs to forward some information to retain the context