Defines the data fields for each entity type (non-relational properties)
Defines how entities reference each other (relational properties)
Optional configuration to customize generation behavior
// Generate a simple directed graph where nodes link to other nodes
fc.entityGraph(
{ node: { id: fc.stringMatching(/^[A-Z][a-z]*$/) } },
{ node: { linkTo: { arity: 'many', type: 'node' } } },
)
// Produces: { node: [{ id: "Abc", linkTo: [<node#1>, <node#0>] }, ...] }
Generates interconnected entities with relationships based on a schema definition.
This arbitrary creates structured data where entities can reference each other through defined relationships. The generated values automatically include links between entities, making it ideal for testing graph structures, relational data, or interconnected object models.
The output is an object where each key corresponds to an entity type and the value is an array of entities of that type. Entities contain both their data fields and relationship links.