#Work with references
Reference fields let you connect content entries to one another directly from the content editor. This page covers everything you need to work with reference fields as an editor.
#Connect an entry
Reference fields appear inline in the content entry form. An empty reference field shows two options: a button to add an existing entry from the referenced model, and a button to create and connect a new one. The button labels include the model name, for example, Add existing Article or Create new Article.
#Add an existing entry
- Open the content entry that contains the reference field.
- Click the Add existing button. The label includes the model name, for example, Add existing Article.
- In the Select modal, use the search bar or Filter to find the entry you want.
- Select the entry by clicking its row.
- Click Add selected entries.
You can select multiple entries at once if the reference field allows more than one connection.
#Create and connect a new entry
If the entry you want to connect does not exist yet, click the Create new button. The label includes the model name, for example, Create new Article. This opens a new entry form for the referenced model. Fill in the required fields and save. Hygraph connects the new entry to the reference field automatically. For more information, see Create a content entry.
#Remove a connected entry
To remove a connection, open the content entry and locate the reference field. Hover over the connected entry to reveal the context menu, then select Remove.
Removing a connection does not delete the referenced entry. It only unlinks it from this field.
If the field has a Required validation, removing a connected entry triggers a warning and blocks publishing until you fulfill the validation requirements.
#Sort connected entries
Reference fields that allow multiple connections support drag-and-drop reordering.
- Open the content entry that contains the reference field.
- Locate the reference field in the entry form.
- Use the six-dot handle on the left of each connected entry to drag and drop it into the order you want.
#One-way and two-way references
How a reference field behaves depends on how your schema developer configured it.
One-way references are visible and editable only from the model where the field was added. If a Post references an Author one-way, you can select an author from the Post entry. Opening an Author entry shows no corresponding field listing connected posts.
Two-way references are visible from both sides of the relation. If the same Post to Author reference is two-way, opening an Author entry shows a field listing all posts connected to it. You can manage the connection from either entry.
If you expect to see a reference field in a model but cannot find it, the reference is likely configured as one-way. Contact your schema developer if you need the field to be visible from both sides.
#Validation warnings
Some reference fields have validation rules set by your schema administrator. Two types of validation can appear:
Require a connected entry shows a Required tag on the field. If you save or attempt to publish without connecting an entry, Hygraph displays a warning and blocks publishing until the requirement is met.
Limit connected entry count applies to fields that accept multiple connections. If you add more entries than the maximum, or fewer than the minimum, a warning appears and blocks publishing.
These validations apply in the UI only. Keep the following in mind:
- An entry that exists as a draft but has not been published still counts as connected.
- If a referenced entry is deleted or disconnected from the other side of a two-way reference, Hygraph removes the link automatically but does not display an error. For example, if an Article requires a linked Product and someone deletes that Product, the Article loses the connection silently. You will only notice the missing link the next time you open the Article.
- These validations are not enforced at the API level. Links can be removed or left empty via the API without triggering any warning.
#Read-only and hidden fields
Reference fields configured as Read only are visible in the entry form but cannot be edited. Fields configured as API only or Hidden do not appear in the content editor at all. If you need to edit a field you cannot see or change, contact your schema administrator.
#What's next
- Create a content entry: Learn how to create an entry before connecting it to a reference field.
- References: Understand how reference fields are configured in the schema.