@connect - one to many - nextToken usage
See original GitHub issueNote: If your question is regarding the AWS Amplify Console service, please log it in the official AWS Amplify Console forum
Which Category is your question related to? API GraphQL
Amplify CLI Version
You can use amplify -v
to check the amplify cli version on your system
4.45
What AWS Services are you utilizing? Lambda, AppSync, Cloudfront, DynamoDB.
Provide additional details e.g. code snippets
I set up a one-to-many relationship between a couple of model. It works fine. I’m able to query for the one model record and from that get the many model records. However, I set a limit of 10 for the many model records but it’s not obvious to me how to use the nextToken
value to retrieve the other many model records.
I’ve tried using the list query for the many model and the list query for the one model but I get the invalid start key error. How can I use the nextToken
value to get the other many model records?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
@yuth it appears to be working. Thanks for your help!
BTW, is this anywhere in the docs? I couldn’t find anything like this and not sure if it’s not there or I just didn’t look in the right places.
@codeinaire the
mappingDatas
field can take an argument callednextToken
and when you pass that it would use that value to paginate the mapping data. So the updated query would look somewhat like thisWhen trying to get the next page of
mappingData
pass the you will need to pass thenextToken
frommappingDatas
of eachlistPageFormss
tomappingDataNextToken