Fork me on GitHub
#fulcro
<
2021-08-29
>
Alister Lee10:08:01

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!

wilkerlucio14:08:05

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?

2
Alister Lee10:08:11

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...