How to call multiple time amplify query in react JS

ashishdonga

Ashish donga

Posted on April 19, 2022

How to call multiple time amplify query in react JS

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)

        })
        )
Enter fullscreen mode Exit fullscreen mode

thank you for reading How to call multiple time amplify query in react JS

๐Ÿ’– ๐Ÿ’ช ๐Ÿ™… ๐Ÿšฉ
ashishdonga
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.

Related

ยฉ TheLazy.dev

About