This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-29
Channels
- # announcements (2)
- # beginners (17)
- # calva (3)
- # cljdoc (3)
- # cljsrn (7)
- # clojure (99)
- # clojure-europe (6)
- # clojurescript (18)
- # clojureverse-ops (2)
- # cryogen (1)
- # cursive (11)
- # datomic (2)
- # duct (6)
- # figwheel-main (2)
- # fulcro (3)
- # graalvm (2)
- # honeysql (1)
- # introduce-yourself (5)
- # leiningen (4)
- # meander (11)
- # membrane (14)
- # practicalli (1)
- # re-frame (4)
- # reagent (5)
- # rum (1)
- # shadow-cljs (17)
- # spacemacs (13)
- # tools-deps (6)
Is it good practice to query from a root edge through its vec of idents?
If I query for all my accounts, they are the contents of the [:account/id '_]
, so perhaps there's a way to avoid the {[:account/all '_] (comp/get-query Account)}
? Thanks!
hello Alister, an issue with pulling all the entities is that you have little control about what they are, so for instance, you may have accounts that are part of a creating object that are not real accounts yet. to handle this, a common pattern is to use an attribute to define the list of accounts (that could be something like :account/all
), so in Pathom you can have that list returning all accounts, and given this is likely to be a resolver that has no input, you will be able to ask for that from any component. makes sense?
Thanks for the comment Wilker - I guess you can never be sure that "all the items/accounts" stay forever being the set you assume, so we just don't go there...