Fork me on GitHub
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!


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?

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