Créer une instance d'une entité
3 min
Vue d’ensemble
Chaque entité expose deux fonctions équivalentes pour créer une nouvelle instance :
- $[EntityName]
- create[EntityName]
Info
Ces fonctions permettent d’instancier une entité sans fournir de paramètres, ou en passant explicitement null ou undefined.
Entité racine
// Create new instances of `Project` type
await $Project();
await $Project(null);
await $Project(undefined);
await createProject();Entité non racine
// Create new instances of `Company` type,
// where `Company` is a direct child of `Project`
await $Company(parentEntity);
await $Company(parentEntity, null);
await $Company(parentEntity, undefined);
await createCompany(parentEntity);