A Relationship field links a record in one table to a record (or records) in another. Unlike a UUID or a Text field, it doesn’t store a free-form value — it stores a reference to a row in another table and enforces that the reference is valid. When you add a relationship, Archie creates the corresponding inverse field on the other side automatically, so the connection works in both directions. The auto-generated GraphQL API exposes the relationship as a nested field, letting you fetch a record and its related records in a single query.Documentation Index
Fetch the complete documentation index at: https://archie.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Cardinality
| Cardinality | What it means | Example |
|---|---|---|
| One-to-One | Record A links to exactly one Record B, and vice versa. | User ↔ Profile — every user has one profile. |
| One-to-Many | Record A is linked to many Record Bs, but each Record B belongs to one Record A. | Author ↔ Books — an author writes many books, each book has one author. |
Creating a relationship
Open the configuration
Click the configuration icon on the right side of the field row to open the relationship settings.

When you create a relationship, Archie automatically adds the inverse field on the related table — for example, adding
author on books also exposes books as a nested field on author. You don’t need to set it up on both sides.How it appears in the API
The relationship is exposed in GraphQL as a nested field. Given anAuthor with a one-to-many books relationship, you can fetch both in one query:
Permissions
A relationship field is governed by the read and write permissions on both tables. A user has to be able to read a related table for it to appear in the nested query. Configure this in Role-Based Access.FAQ
How do I model many-to-many?
How do I model many-to-many?
Create a join table with one-to-many relationships pointing to each side. For example, a
students_courses join table linking students and courses gives you the many-to-many. See Relationships for the full pattern.What happens if I delete a record that other records reference?
What happens if I delete a record that other records reference?
The default behavior is to prevent the deletion when there are referencing rows. See Relationships for cascade and nullify options.
Do I need to add a UUID field for the foreign key separately?
Do I need to add a UUID field for the foreign key separately?
No. The relationship field is itself the foreign key — it stores the reference to the related table’s primary key.
Can I rename a relationship after creating it?
Can I rename a relationship after creating it?
Yes. Rename the field on the Schema tab. The GraphQL nested field name updates immediately; any client code that uses the old name will need to be updated.