Documentation / @zerotal/orm / index / RelationNotLoadedError
Class: RelationNotLoadedError
Defined in: packages/orm/src/errors/RelationNotLoadedError.ts:10
Thrown when a relation is accessed on a model that was not eager-loaded with
.with('relation'), guarding against accidental lazy loads / N+1 queries.
Param
relation
The relation name that was accessed.
Param
model
The model the relation was accessed on.
Extends
Constructors
Constructor
new RelationNotLoadedError(
relation,model):RelationNotLoadedError
Defined in: packages/orm/src/errors/RelationNotLoadedError.ts:11
Parameters
relation
string
model
string
Returns
RelationNotLoadedError
Overrides
Properties
code
readonlycode:string
Defined in: packages/core/src/errors/ZerotalError.ts:18
Inherited from
status
readonlystatus:number=500
Defined in: packages/core/src/errors/ZerotalError.ts:19
Inherited from
context?
readonlyoptionalcontext?:Record<string,unknown>
Defined in: packages/core/src/errors/ZerotalError.ts:20