@tenantFanOut runs a field’s query once for every tenant the request may see, in parallel, and returns the combined results as one list.

type Query {
  resultater: [Resultat] @tenantFanOut
}

The field must return a list of a tenant-scoped @table type. Which tenants are queried is decided per request: the tenant collection your application supplies to the generated factory (see How-to: Tenant scoping) intersected with the tenants this deployment actually hosts. A tenant in your collection that the deployment does not host is a request error before any SQL runs; a hosted tenant absent from your collection is never queried.

SDL signature

directive @tenantFanOut on FIELD_DEFINITION

The directive carries no arguments: fan-out cannot be inferred, it must be asked for, but what it fans over is a request-level fact, so there is nothing for a directive argument to say.

Element nullability chooses what happens when one tenant fails

With [Resultat], a tenant whose database is unreachable or times out contributes a single null element after the successful rows, and the response’s errors array carries an entry whose path points at that element; results from healthy tenants still return. With [Resultat!], any tenant failure nulls the whole field instead. Pick per field; there is no global switch.

Ordering

Results keep each tenant’s @orderBy ordering within that tenant’s rows and concatenate tenants in a stable order; they are not re-sorted globally. Fields below the fanned field need nothing extra: each row remembers its tenant, and nested selections (including @splitQuery children) read and route against the right database automatically.

Build-time rejections

@tenantFanOut is rejected at build time on: mutation fields, non-list fields, @asConnection fields, @lookupKey fields, interface- or union-typed fields, fields whose data is not tenant-scoped, fields where the tenant is already determined (an argument bound to the tenant column, or any ancestor that fixed the tenant, including another @tenantFanOut), and @service / @routine fields (fan-out generates the SQL itself). In this first iteration the marker is supported on root fields and on fields of @table-backed parents; fields of class-, record-, or nesting-backed parents are rejected. It also rejects in builds that configure no <tenantColumn>: with no tenants, there is nothing to fan out over.