# `data.reference_cycle`

Required references form a cycle.

Area 5, [Data](../topics/data.md); not declinable; the next step is usually the human's.

Neither record could be created first, whatever happens on delete:

```jadpo
entity Team {
    id: Uuid
    lead_id: Member.id {
        on_delete: OnDelete.restricted
    }
}

entity Member {
    id: Uuid
    team_id: Team.id {
        on_delete: OnDelete.restricted
    }
}
```

```text
error: Required references form a cycle through `Member`
 --> main.jadpo:10:5
   |
 3 |     lead_id: Member.id {
   |     ------- and this one
10 |     team_id: Team.id {
   |     ^^^^^^^ required reference
  reason: `Member.team_id` and `Team.lead_id` are both required, so no record could be created first: each needs one that already exists.
  next: Make one of these references optional (`X.id?`) (human)
  rule: data.reference_cycle
  help: https://jadpo.dev/docs/errors/data.reference_cycle

check failed: 1 error, 1 file
```
