Homepage

RelationOnDemandInterface

Last edit: Oct 26, 2022

No description

interface RelationOnDemandInterface {
  model(
    foreign_property: String = "id"
    join_on_property: String
    model_name: String
  ): ListingsCustomization
  models(
    foreign_property: String!
    join_on_property: String!
    model_name: [String]
  ): [ListingsCustomization!]
  related_model(
    foreign_property: String = "id"
    join_on_property: String
    model_schema_name: String
  ): ListingsCustomization
  related_models(
    foreign_property: String!
    join_on_property: String!
    model_schema_name: [String]
  ): [ListingsCustomization!]
  related_user(
    foreign_property: String = "id"
    join_on_property: String = "user_id"
  ): User
  user(
    foreign_property: String = "id"
    join_on_property: String = "user_id"
  ): User
}

Fields

model (ListingsCustomization)

Defines belongs-to relation with other model; ex: parent: model(model_name:
"parent", join_on_property: "parent_id") { id }

Load resources with foreign_property == join_on_property

Load remote resource with id == join_on_property

Joins model [formaly customization] with custom-model-type-name == model_name

models (ListingsCustomization)

Defines has-many relation with other model; ex: children: models(model_name:
"child", join_on_property: "parent_id", foreign_property: "parent_id") { id }

Load resources with foreign_property == join_on_property

Load resources with foreign_property == join_on_property

Joins model [formaly customization] with custom-model-type-name == model_name

Defines belongs-to relation with other model; ex: parent: model(model_name:
"parent", join_on_property: "parent_id") { id }

Load resources with foreign_property == join_on_property

Load remote resource with id == join_on_property

Joins model [formaly customization] with custom-model-type-name == model_name

Defines has-many relation with other model, returns maximum of 10000 records
at once; ex: children: models(model_name: "child", join_on_property:
"parent_id", foreign_property: "parent_id") { id }

Load resources with foreign_property == join_on_property

Load resources with foreign_property == join_on_property

Joins model [formaly customization] with custom-model-type-name == model_name

Defines relation with other user, returns maximum of 10000 records at once;
ex: invited_by: user(join_on_property: "invited_by_id") { id }

user (User)

Defines relation with other user; ex: invited_by: user(join_on_property: "invited_by_id") { id }

Questions?

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

contact us