ash v0.3.0 Ash.Api View Source
An Api allows you to interact with your resources, anc holds non-resource-specific configuration.
Your Api can also house config that is not resource specific. Defining a resource won't do much for you. Once you have some resources defined, you include them in an Api like so:
defmodule MyApp.Api do
use Ash.Api
resources [OneResource, SecondResource]
end
Then you can interact through that Api with the actions that those resources expose.
For example: MyApp.Api.create(OneResource, %{attributes: %{name: "thing"}})
, or
MyApp.Api.read(query)
. Corresponding actions must
be defined in your resources in order to call them through the Api.