Skip to content

Confusing Field Naming in Many-to-Many Relationship Documentation #8252

Open

Description

@k-allagbe

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 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.

URL page where content issue is:

https://docs.amplify.aws/nextjs/build-a-backend/data/data-modeling/relationships/#model-a-many-to-many-relationship

Activity

  1. added
    amplify/data
    community-issue
    on Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    amplify/datacommunity-issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions