Homepage

HasRecordsInterface

Last edit: Oct 13, 2026

Object that can load related records

interface HasRecordsInterface {
  related_record(
    filter: RecordsFilterInput
    foreign_property: String = "id"
    join_on_property: String!
    sort: [RecordsSortInput!]
    table: [String]!
  ): Record
  related_records(
    filter: RecordsFilterInput
    foreign_property: String!
    join_on_property: String!
    limit: Int
    sort: [RecordsSortInput!]
    table: [String]!
  ): [Record!]
}

Fields

Returns one record of the given table whose foreign_property equals the value
of join_on_property of this object (belongs-to or has-one relation). When
several records match, the last one in sort order is returned, by default the
most recently updated; ex: parent: related_record(table: "parent",
join_on_property: "parent_id") { id }

Additional conditions the related record must match

Name of the property (or attribute, e.g. id) of the related object that must equal the value of join_on_property

Name of the property (or attribute, e.g. id or user_id) of this object whose
value is matched against foreign_property. When the value is an array,
records matching any of its elements are returned. Returns an error when
this object has no such property

Sort order used to pick the record; updated_at ascending when omitted

Name of the table (or tables) the related record belongs to

Returns records of the given table whose foreign_property equals the value of
join_on_property of this object (has-many relation). Related records of all
objects in the result are loaded in one batch of at most 10,000 records,
soft-deleted records are skipped; ex: children: related_records(table:
"child", join_on_property: "id", foreign_property: "parent_id") { id }

Additional conditions the related records must match

Name of the property (or attribute, e.g. id) of the related object that must equal the value of join_on_property

Name of the property (or attribute, e.g. id or user_id) of this object whose
value is matched against foreign_property. When the value is an array,
records matching any of its elements are returned. Returns an error when
this object has no such property

Maximum number of related objects returned for each object

Sort order of the related records; updated_at ascending when omitted

Name of the table (or tables) the related records belong to

Questions?

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

contact us