I am having trouble sorting my DynamoDB database by createdAt
I am working from the AWS console. I’m using AWS AppSync and DynamoDB for the back-end, and React and Apollo Client for the front-end. I’m not using AWS Amplify (company policy)
My original DynamoDB table doesn’t have a createdAt column, which I think is adding to the issue
I have tried creating mutations to add in new records WITH a createdAt timestamp, but it is not working.
I have tried writing queries multiple different ways.
I have tried updating my Type in Schema to include "@model (timestamps: etc.)"
I have tried adding this to the response template for the schema resolver: "$util.time.nowISO8601()"
What is the best way be able to sort the records according to most recent to least and vice versa? With AWS AppSync, DynamoDB, ApolloClient, and React, not AWS Amplify
If you could, please specify if I need to change up my Type, or my Query/mutation, or what the query should look like
Thank you