# `Diffo.Provider.DomainFragment`
[🔗](https://github.com/diffo-dev/diffo/blob/v0.9.0/lib/diffo/provider/domain_fragment.ex#L5)

Domain fragment for Ash domains that extend the Diffo Provider.

Include this fragment in any domain whose resources need to participate in provider
polymorphism — i.e., where `belongs_to :instance, Diffo.Provider.Instance` or
`belongs_to :party, Diffo.Provider.Party` relationships must resolve via `manage_relationship`.

Adding this fragment causes AshNeo4j to write `:Provider` as an additional label on every
node in the domain at CREATE time. Because AshNeo4j MATCH patterns include all node labels,
`Ash.get(Diffo.Provider.Instance, uuid)` (which matches on `[:Provider, :Instance]`) will
then find concrete instance nodes (e.g. `ShelfInstance`) that carry both `:Instance` (from
`BaseInstance`) and `:Provider` (from this fragment).

## Usage

    defmodule MyApp.SRM do
      use Ash.Domain, fragments: [Diffo.Provider.DomainFragment]
      ...
    end

Forgetting this is a silent footgun (no `:Provider` label → projection and ref
resolution quietly fail), so `Diffo.Provider.Extension.Verifiers.VerifyProviderDomain`
enforces it at compile time: a provider resource whose domain emits no `:Provider`
label fails to compile with a message pointing here.

# `extensions`

# `opts`

# `persisted`

# `spark_dsl_config`

# `validate_sections`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
