The error surface presented when a create condition names a single-valued
relationship that is not a BelongsTo backed by a typed foreign key.
Never written by hand: it is the type such a relationship key takes in a
CreateCondition, so the compile error quotes its message.
A new entity has no HasOne child yet, so only its parents can be guarded,
and a parent is known at compile time only through a foreign key declared
with its target type.
Example
// Customer declares @HasOne(() => ContactInformation, ...) contactInformation awaitCustomer.create( { name:"Jane Doe", status:"active" }, // Compile error naming this surface: a new Customer has no contact yet { condition: { contactInformation: { email:"jane@example.com" } } } );
interfaceCreateRelationshipConditionError{ __writeConditionError:"create guards only a BelongsTo relationship whose foreign key is declared with its target type, ForeignKey<Target> or NullableForeignKey<Target>"; }
__writeConditionError:"create guards only a BelongsTo relationship whose foreign key is declared with its target type, ForeignKey<Target> or NullableForeignKey<Target>"
The error surface presented when a create condition names a single-valued relationship that is not a BelongsTo backed by a typed foreign key.
Never written by hand: it is the type such a relationship key takes in a CreateCondition, so the compile error quotes its message.
A new entity has no HasOne child yet, so only its parents can be guarded, and a parent is known at compile time only through a foreign key declared with its target type.
Example