Ash.Api.Dsl (ash v1.48.0-rc.8) View Source
A small DSL for declaring APIs
Apis are the entrypoints for working with your resources.
Apis may optionally include a list of resources, in which case they can be
used as an Ash.Registry in various places. This is for backwards compatibility,
but if at all possible you should define an Ash.Registry if you are using an extension
that requires a list of resources. For example, most extensions look for two application
environment variables called :ash_apis and :ash_registries to find any potential registries
Table of Contents
- resources
- resource
resources
List the resources present in this API
Examples:
resources do
resource MyApp.User
resource MyApp.Post
resource MyApp.Comment
end
:define_interfaces?- If set to true, the code interface of each resource will be defined in the api.
Keep in mind that this can increase the compile times of your application. The default value isfalse.
resource
A reference to a resource
Introspection Target:
Examples:
resource MyApp.User:resource- Required. The module of the resource