Edit on GitHub

Conditional Joins

In order to make sure we could support GraphQL syntax, we also enabled Conditional Joins. You can now restrict which models get joined on a query.

User.query()
  .where({posts__body__icontains: 'Minecraft'})
  .join('posts', {body__icontains: 'Minecraft'})
  .end((err, users) => {

    // All users who have posted about minecraft, containing their
    // minecraft-related posts

  });