We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da3d89f commit b918c48Copy full SHA for b918c48
docs/recipes/structuring-reducers/UpdatingNormalizedData.md
@@ -227,12 +227,11 @@ export class Comment extends Model {
227
return {
228
id: attr(),
229
text: attr(),
230
- // Define a foreign key relation - one Post can have many Comments,
231
- // at a field named "comments"
+ // Define a foreign key relation - one Post can have many Comments
232
postId: fk({
233
- to: 'Comment',
234
- as: 'post',
235
- relatedName: 'comments'
+ to: 'Post', // must be the same as Post.modelName
+ as: 'post', // name for accessor (comment.post)
+ relatedName: 'comments' // name for backward accessor (post.comments)
236
})
237
}
238
0 commit comments