View Source Bonfire.Common.ContextModule behaviour (Bonfire v0.9.10-classic-beta.169)
Find a context or query module via its schema, backed by a global cache of known modules.
Summary
Callbacks
Declares a context module
Points to the related queries module
Points to the related schema module
Functions
Get a context identified by schema
Look up a context, throw :not_found if not found.
Look up many contexts at once, throw :not_found if any of them are not found
Given an object or schema module name, run a function on the associated context module. TODO: refactor to re-use Utils.maybe_apply?
Callback implementation for Bonfire.Common.ExtensionBehaviour.modules/0
.
Callbacks
Functions
Get a context identified by schema
Look up a context, throw :not_found if not found.
Look up many contexts at once, throw :not_found if any of them are not found
maybe_apply(object_schema_or_context, fun, args \\ [], opts \\ [fallback_fun: &apply_error/2])
View SourceGiven an object or schema module name, run a function on the associated context module. TODO: refactor to re-use Utils.maybe_apply?
@spec modules() :: [atom()]
Callback implementation for Bonfire.Common.ExtensionBehaviour.modules/0
.