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.3 Replies
Solution
Read actions return multiple results always
You'd just return a list of one thing
Thanks Zack!