Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gen2] - Feature Request to set indexName or fields on relationships #2315

Closed
2 tasks done
aroradev-dms opened this issue Mar 3, 2024 · 1 comment
Closed
2 tasks done
Labels
duplicate This issue or pull request already exists feature-request New feature or request Gen 2 pending-response

Comments

@aroradev-dms
Copy link

Describe the feature you'd like to request

In V1, we can set up a custom field to store the reference of the parent object.

Link : https://docs.amplify.aws/javascript/build-a-backend/graphqlapi/data-modeling/#belongs-to-relationship

An example bidirectional has many relationship is shown below :-

type Post @model {
  id: ID!
  title: String!
  comments: [Comment] @hasMany(indexName: "byPost", fields: ["id"])
}
type Comment @model {
  id: ID!
  postID: ID! @index(name: "byPost", sortKeyFields: ["content"])
  content: String!
  post: Post @belongsTo(fields: ["postID"])
}

However, we cannot seem to achieve this in V2.

Describe the solution you'd like

I would like to propose this FR to achieve this in V2.

Describe alternatives you've considered

NA

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request

Would this feature include a breaking change?

  • ⚠️ This feature might incur a breaking change
@AnilMaktala AnilMaktala added Gen 2 duplicate This issue or pull request already exists feature-request New feature or request and removed pending-triage labels Mar 4, 2024
@AnilMaktala
Copy link
Member

Hey @aroradev-dms, Thank you for bringing this to our attention. It appears to be a duplicate of #2312. Please review #2312 and share your comments there. If you believe this is a different feature request, please inform us, and we will keep this ticket open for the team to conduct a more in-depth review and evaluation.

@AnilMaktala AnilMaktala closed this as not planned Won't fix, can't repro, duplicate, stale Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists feature-request New feature or request Gen 2 pending-response
Projects
None yet
Development

No branches or pull requests

2 participants