-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 - Unable to query with sorting #13527
Comments
Hey,👋 thanks for raising this! I'm going to transfer this over to our API repository for better assistance 🙂 |
Hi @grfortun, Thanks for bringing this up. We can reproduce the issue and will mark it as a bug for the team to further evaluate. |
@grfortun - Thanks for creating this issue! The reason you're seeing this type error is because you are providing const { data, errors } = await client.models.Todo.listByDate(
{
accountRepresentativeId: '1',
},
{
sortDirection: 'ASC',
},
); I just checked this myself, and I'm seeing the options params suggested correctly in my IDE. Can you confirm that you are seeing this as well? Thank you! |
Hi 👋 Closing this as we have not heard back from you. If you are still experiencing this issue and in need of assistance, please feel free to comment and provide us with any information previously requested by our team members so we can re-open this issue and be better able to assist you. Thank you! |
@david-mcafee When ever I create a new secondary indexes or update secondary indexes, it erases the data from Database. Is that suppose to happen? this is my schema:
|
Yes, that is expected behavior for sandbox environments. Those changes are destructive. |
thanks for the response and clarification. I was worried this might happen in prod also. |
Environment information
Description
I am query with sorting by date but facing issues with using the
sortDirection
property. Following the Gen 2 documentation:[+] https://docs.amplify.aws/react/build-a-backend/data/data-modeling/secondary-index/
Schema:
Query:
Error:
When running my application the query works fine and sorts the data accordingly but I am unable to build my application as I am faced with the following error:
The text was updated successfully, but these errors were encountered: