-
Notifications
You must be signed in to change notification settings - Fork 79
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
Support @hasMany configures a default secondary index in gen2 #2312
Comments
Hey @sevenkkk, Thank you for your request. We will label this as a feature request for the team to review in more detail. |
Hi @sevenkkk - we're actually rethinking relationships all up in our Gen 2 experience. There are a few edits that we want to apply as part of the workflow:
while we're making these updates, I wanted to clarify your use case more. Is it primarily the fact that you want to setup multiple relationships between the same models and/or want to customize the field / index in which the relationship info is stored? |
Hi @renebrandel - I have a table that needs to describe the management relationship between fathers and sons, and here is the model I have defined:
My requirement is to retrieve categories starting from the root and for each level, sort them based on the order field.
When calling tags(), I understand that it's using the gsi-GenreTag.tags index, which doesn't provide the desired sorting. Is it possible to use a custom index, such as genreTagTagsId, for sorting purposes? |
Hi @sevenkkk - we've got a task on our backlog to support sort direction for the sortKey fields. So yes, you are on the right track with using secondary indexes. The sort direction on the sort keys is available in the underlying GraphQL API but not exposed to the client code |
Hi~ @renebrandel - Also, I think binding @hasmany to a custom index is another topic. For getting "Has Many" relationships you can follow a custom index, I'm not sure if this is planned (including client-side). |
Hey @sevenkkk, The latest version now includes support for sorting in custom indexes. Please verify in the latest version and let us know. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the feature you'd like to request
This is the implementation of v6:
Use a.hasMany() in gen2:
I want to implement the default use of the default index for byPost
Describe the solution you'd like
Support associated attributes
Describe alternatives you've considered
no
Additional context
No response
Is this something that you'd be interested in working on?
Would this feature include a breaking change?
The text was updated successfully, but these errors were encountered: