Use sortField (& limit) with new @connection syntax
Which Category is your question related to?
GraphQL @connection
Amplify CLI Version
4.13.0
What AWS Services are you utilizing?
DynamoDB, Amplify Console, AppSync, Cognito, SES
Question
In the docs, using the 'old, alternative' way, you can add a sortField to a GraphQL connection, like so:
directive @connection(name: String, keyField: String, sortField: String, limit: Int) on FIELD_DEFINITION
However, I cannot find a way to do that with the new syntax:
directive @connection(keyName: String, fields: [String!]) on FIELD_DEFINITION
And what about the limit?
Thank you for any help!
Closing this is as a duplicate of #1703. Please follow that thread for updates.
@SwaySway thanks i will follow that issue regarding the limit. However, issue #1703 does not address the sortField.
@SwaySway - please re-open. As @FemkeBuijs states, the sortField issue is not addressed in the linked issue.
@thomasklein-winemaker sortField is controlled by the @key directive with the new syntax. The first field is the partition key, and the other fields are concatenated to make up the sort key. By default the @connection will scan forward based on the sort field.
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.