You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
JavaScript Framework
React
Amplify APIs
GraphQL API
Amplify Categories
api
Environment information
# Put output below this line
Describe the bug
We are using graphql queries for fetching data from dynamodb but records are not fetching properly when the table data is large.
When setting the limit it returns only some of the data.
Please suggest a workaround
Expected behavior
All the records that is set by the limit should be fetched from the table.
Reproduction steps
Install '...'
Configure '...'
Go to '...'
See error
Code Snippet
// Put your code below this line.module.exports=functiongetAWSAppSync(token){constgetFunctionToken=async()=>awaittoken;constclient=newAWSAppSyncClient({url: aws_exports.aws_appsync_graphqlEndpoint,region: aws_exports.aws_appsync_region,auth: {type: AUTH_TYPE.AWS_LAMBDA,token: ()=>getFunctionToken()},disableOffline: true});returnclient;}/** * Find the record inside the model using a filter query * * @param {} filter - Filter(and|or) * @param {} entity - Model Name */asyncfindByQuery(filter,entity){// Getting graphql queriesvarquery=_actions(entity,"list");constresult=awaitthis.client.query({query: gql(query),fetchPolicy: 'no-cache',variables: {filter: this.getQuery(filter),limit: 10000}});varmethod="list"+_type(entity,true);returnresult["data"][method]["items"];}
Log output
// Put your logs below this line
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered:
Hey @Ni7iN 👋 Thanks for raising this issue. From what I can find, there seems to be a 1000 record fetch limit for AppSync queries. Here is the relevant documentation
Iterations in a foreach loop in mapping templates
The maximum number of iterations in a #foreach...#end loop in mapping templates
1000
The workaround seems to be querying the 1000 records and then paginating.
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!
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
GraphQL API
Amplify Categories
api
Environment information
Describe the bug
We are using graphql queries for fetching data from dynamodb but records are not fetching properly when the table data is large.
When setting the limit it returns only some of the data.
Please suggest a workaround
Expected behavior
All the records that is set by the limit should be fetched from the table.
Reproduction steps
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: