Ashish donga
Posted on April 19, 2022
How to call multiple time amplify query in react JS
How To Use The Same GraphQL Query Multiple Times In A Single API Call. Amplify, DynamoDB
const response = await Promise.all(
signupData.educationalDetails.map(async (item) => {
console.log("item",item)
const variables = {
studentId: newTodo?.data?.createStudent?.id,
examPassed: item?.data?.boardType,
boardName: item?.data?.boardName,
passingYear: item?.data?.boardYear,
percentage: item?.data?.boardPercentage,
resumeUrl: item?.data?.boardFile
}
console.log("variables", variables)
try{
const newTodo2 = await API.graphql({ query: mutations.createEducational, variables: { input: variables } });
}catch(e){
console.log("####",e)
}
console.log('newTodo2Demo', { query: mutations.createEducational, variables: { input: variables } })
return{
boardName: item?.data?.boardName
}
// console.log('newTodo2Demo', newTodo2)
})
)
thank you for reading How to call multiple time amplify query in react JS
๐ ๐ช ๐
๐ฉ
Ashish donga
Posted on April 19, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.