ACM Fields - Relationship - Reverse Relationships
Relationship Field (Beta) - Reverse Relationships
The Reverse Relationship option displays the corresponding linked model in the publisher side of the application for that particular model. You can also use Reverse Relationship to expose the Reverse Relationship in WPGraphQL.
For example, if a company has employees, if you check reverse relationship in Company, it would show the linked companies in the Employee edit page.
Steps to Use the Relationship Field Reverse Relationships
-
After navigating to a model, click the + button or if it’s the first field, click on the Relationship option.
-
Choose the Relationship Field type.
-
Fill in the form fields to fit your needs.
-
Under the Reverse Reference section, check Configure Reverse Reference to make the relationship bidirectional. This allows the management of connections from the reverse side of the relationship, and it adds the reverse relationship data to the WPGraphQL graph.
-
Give a meaningful name for the Reverse Display Name. For example, if you want to reference Cages for a Rabbit model. Name the Reverse Display Name something like Rabbit Cages. The Reverse API Identifier is auto-generated but can be adjusted if you prefer something else.
-
Click Create when done to save the field to the model.
-
Click Cancel to stop field creation.