View Source Ash.Domain behaviour (ash v3.0.0-rc.40)

A domain allows you to interact with your resources, and holds domain-wide configuration.

For example, the json domain extension adds a domain extension that lets you toggle authorization on/off for all resources in a given domain. You include resources in your domain like so:

defmodule MyApp.MyDomain do
  use Ash.Domain

  resources do
    resource OneResource
    resource SecondResource
  end
end

Options

  • :validate_config_inclusion? (boolean/0) - Whether or not to validate that this domain is included in the configuration. The default value is true.

  • :extensions (list of module that adopts Spark.Dsl.Extension) - A list of DSL extensions to add to the Spark.Dsl

  • :otp_app (atom/0) - The otp_app to use for any application configurable options

  • :fragments (list of module/0) - Fragments to include in the Elixir.Spark.Dsl. See the fragments guide for more.

Summary

Types

Callbacks

@callback domain?() :: true