docs: function readForRelated(mode, sourceModel, id, relation, query) {
    return _by_id2['default'](sourceModel, id, relation).then(function (result) {
      if (!result) {
        throw _kapow2['default'](404);
      }
      var relatedData = _related2['default'](result, relation);
      var hasMany = _is_many2['default'](relatedData);
  
      var relatedModel = hasMany ? relatedData.model : relatedData.constructor;
      var relatedIds = hasMany ? relatedData.map(function (m) {
        return m.id;
      }) : relatedData.id;
  
      // @todo fix this
      // currently, the route param :id winds up represented
      // as filter.id. this can cause collisions when doing
      // requests like GET /book/1/stores?filter[id]=2
      // the intent is to limit the stores related to the book to those
      // with the id one, but the actual impact is that it looks up
      // book id #2. see RequestHandler#read
      query.filter.id = query.filter.id ? _lodash2['default'].intersection(relatedIds, query.filter.id) : relatedIds;
  
      query.singleResult = !hasMany;
  
      return _read2['default'](relatedModel, query, mode).then(function (relatedResult) {
        relatedResult.sourceModel = result;
        relatedResult.relationName = relation;
        return relatedResult;
      });
    });
  }