You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation for modeling a many-to-many relationship in the Next.js guide might be confusing. The tags field in the Post model and the posts field in the Tag model are defined as a.hasMany('PostTag', 'postId') and a.hasMany('PostTag', 'tagId'), respectively. However, these fields reference the PostTag model rather than directly referencing Tag or Post. This could mislead developers into thinking they are directly retrieving related Tag or Post records, when they are actually retrieving PostTag entries.
A clearer naming convention or additional explanation in the documentation would help avoid confusion.
Describe the content issue:
The documentation for modeling a many-to-many relationship in the Next.js guide might be confusing. The
tags
field in thePost
model and theposts
field in theTag
model are defined asa.hasMany('PostTag', 'postId')
anda.hasMany('PostTag', 'tagId')
, respectively. However, these fields reference thePostTag
model rather than directly referencingTag
orPost
. This could mislead developers into thinking they are directly retrieving relatedTag
orPost
records, when they are actually retrievingPostTag
entries.A clearer naming convention or additional explanation in the documentation would help avoid confusion.
URL page where content issue is:
https://docs.amplify.aws/nextjs/build-a-backend/data/data-modeling/relationships/#model-a-many-to-many-relationship
The text was updated successfully, but these errors were encountered: