MishkaGervaz.Form.Entities.DataLoader (MishkaGervaz v0.0.1-alpha.2)

Copy Markdown View Source

Data-loader module overrides — replace the default record / tenant / relation / hook loaders with your own implementations.

Two calling styles. Pass a module positionally to override the entire data loader, or use the block form to swap individual sub-builders while keeping the defaults for the rest:

# Whole-module override
data_loader MyApp.Form.CustomDataLoader

# Per-sub-builder overrides
data_loader do
  record MyApp.Form.DataLoader.RecordLoader
  tenant MyApp.Form.DataLoader.TenantResolver
  relation MyApp.Form.DataLoader.RelationLoader
  hooks MyApp.Form.DataLoader.HookRunner
end

Defaults

When no overrides are specified, the following defaults are used:

  • recordMishkaGervaz.Form.Web.DataLoader.RecordLoader.Default
  • tenantMishkaGervaz.Form.Web.DataLoader.TenantResolver.Default
  • relationMishkaGervaz.Form.Web.DataLoader.RelationLoader.Default
  • hooksMishkaGervaz.Form.Web.DataLoader.HookRunner.Default

See MishkaGervaz.Form.Dsl.DataLoader for the DSL declaration.

Summary

Functions

Transform the data_loader after DSL compilation.

Types

t()

@type t() :: %MishkaGervaz.Form.Entities.DataLoader{
  __spark_metadata__: map() | nil,
  hooks: module() | nil,
  module: module() | nil,
  record: module() | nil,
  relation: module() | nil,
  tenant: module() | nil
}

Functions

transform(data_loader)

Transform the data_loader after DSL compilation.