platformOS Community

How to use graphql query related_record in related_record

piotrze Dec 21 2020 at 10:30

You nest related_record in field results.

query search {
  users(per_page: 10){
    results {
      blog: related_record(table: "blog", join_on_property: "id", foreign_property: "user_id") {
        id
        title: property(name: "title")
        blog_detail: related_record(table: "blog_detail", join_on_property: "id", foreign_property: "blog_id"){
          id
          details: property(name: "details")
        }
      }
    }
  }
}
Please sign in or fill up your profile to answer a question