Ash.Resource.ManualRead And Filters

Hi, I’m wrapping an external REST API with an Ash resource and therefor use Ash.Resource.ManualRead. Reading the data is not a problem, but as the REST API is way less capable for filtering, I would like to run the returned data through the Ash filters I applied to the query. I mapped the returned data already to the Ash resource and now have an array of these resources. But how can I now apply the filters from the query? That’s what read!() normally would do, but calling that would lead to a recursion…
2 Replies
barnabasj
barnabasj2y ago
I'm not completely sure that this works the way you want but there is this guide https://ash-hq.org/docs/guides/ash/latest/how_to/use-without-data-layers. Maybe if you do this instead of a manual read action the filters will be applied inside Ash.Datalayer.Simple
Ash HQ
Guide: Get Started
Read the "Get Started" guide on Ash HQ
Jan Ulbrich
Jan UlbrichOP2y ago
So that’s a manual prepare instead of a manual read. Will try!

Did you find this page helpful?