HasRecordsInterface
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
related_record (Record)
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 }
-
filter(RecordsFilterInput)
Additional conditions the related record must match
-
foreign_property(String)
Name of the property (or attribute, e.g. id) of the related object that must equal the value of join_on_property
-
join_on_property(String)
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(RecordsSortInput)
Sort order used to pick the record; updated_at ascending when omitted
-
table(String)
Name of the table (or tables) the related record belongs to
related_records (Record)
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 }
-
filter(RecordsFilterInput)
Additional conditions the related records must match
-
foreign_property(String)
Name of the property (or attribute, e.g. id) of the related object that must equal the value of join_on_property
-
join_on_property(String)
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
-
limit(Int)
Maximum number of related objects returned for each object
-
sort(RecordsSortInput)
Sort order of the related records; updated_at ascending when omitted
-
table(String)
Name of the table (or tables) the related records belong to