Function

name
String
the name of the relationship
store
Store
an instance of Store
returns
Model
the type of the relationship, or undefined

For a given relationship name, returns the model type of the relationship.

For example, if you define a model like this:

app/models/post.js
1
2
3
4
5
import Model, { hasMany } from '@ember-data/model';

export default class PostModel extends Model {
  @hasMany('comment') comments;
}

Calling store.modelFor('post').typeForRelationship('comments', store) will return Comment.