Wrapping external API - get one object

Hey 👋 I'm starting to learn Ash and I'm trying to use Ash.Resource to wrap an API. Looking at the example at https://hexdocs.pm/ash/wrap-external-apis.html, I can see how I would do that for a paginated list endpoint. Now I'm trying to figure out how to do something similar that returns one object and not a list. The list example uses Stream.resource and Ash.Query.apply_to, so it's not clear to me how to proceed.
Solution:
Read actions return multiple results always
Jump to solution
3 Replies
Solution
ZachDaniel
ZachDaniel•4mo ago
Read actions return multiple results always
ZachDaniel
ZachDaniel•4mo ago
You'd just return a list of one thing
benregn
benregnOP•4mo ago
Thanks Zack!

Did you find this page helpful?