newbie: incorrect code in AshPostgres examples?

https://hexdocs.pm/ash_postgres/get-started-with-ash-postgres.html#aggregates the last example there is about loading aggregates on demand, and includes in particular:
representatives = Helpdesk.Support.read!(Helpdesk.Support.Representative)
representatives = Helpdesk.Support.read!(Helpdesk.Support.Representative)
which is confusing to me as well as the compiler. im new to ash and elixir but how would a domain have a read action? domains dont even take actions. the compiler says (UndefinedFunctionError) function Helpdesk.Support.read!/1 is undefined or private
Solution:
Just to add that you can have code_interfaces on your domain, that have functions you can call. But in that case you won't need to pass the Resource. https://hexdocs.pm/ash/code-interfaces.html
Jump to solution
2 Replies
franckstifler
franckstifler3mo ago
Yes, I think it's an error. Should be Ash.read!
Solution
franckstifler
franckstifler3mo ago
Just to add that you can have code_interfaces on your domain, that have functions you can call. But in that case you won't need to pass the Resource. https://hexdocs.pm/ash/code-interfaces.html

Did you find this page helpful?