Model Relations

With properties, you can create your custom fields for storing the data. In the properties, you can also store the id of an existing object. Then you can fetch the data with model(join_on_property: String!) or the user(join_on_property: String!) field in GraphQL.

In order to export/import data with relations preserved, you need to define them in model schema files using the belongs_to attribute.

app/model_schemas/house.yml

name: house
properties:
- name: address
  type: string

app/model_schemas/cars.yml

name: cars
properties:
- name: color
  type: string
- name: house_id
  type: integer
  belongs_to: house

Questions?

We are always happy to help with any questions you may have.