Record Relations

Last updated on August 14, 2024.

You can create custom fields for storing data using or . allows you to store the of an existing object which you can then use to fetch the data using or the field in GraphQL.

To import/export data with relations preserved, you need to relate the tables using the attribute. This can be done using one of two ways:

  • Relating records using the Instance Admin
  • Relating records via code

Relating records using the Instance Admin

Visit the article Linking Databases Together for an in - depth guide on how to build relations between records using the Instance Admin UI. In a nutshell, the steps are as follows:

  1. Choose the database that you want to add relations to.
  2. Add a field to your chosen database.
  3. Make sure the field you are adding is a 'Data Source' field type.
  4. Select the database table that you want to connect to on the 'Data Source' options.

Relating records via code

To relate records via code, define relations in the Table files using the attribute.

app/schema/house.yml

app/schema/cars.yml

Have a suggestion for this page?

Didn't quite find what you are looking for or have feedback on how we can make the content better then we would love to hear from you. Please provide us feedback and we will get back to you shortly.