aws-amplify / aws-amplify/docs

Confusing Field Naming in Many-to-Many Relationship Documentation

Open
#8,252 0 comments 0 reactions 0 assignees View on GitHub
amplify/data community-issue
Dominant language
MDX
Stars
506
Forks
1.1k
Avg merge
3h 14m
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

Research direction

Open the many-to-many relationship section at the linked Next.js documentation URL and review the Post, Tag, and PostTag field definitions. Clarify that tags and posts reference PostTag entries, either through naming or explanatory text, so the completed page no longer suggests direct related-record retrieval.

Written by the indexing model from the issue text.

Assessment

Tech stack
next.js
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.