Asynchronous loop, use previous answer


I am new to Vue-js and I do not achieve my ends despite all my research …

In an asynchronous mutation loop, I try to use the result (id) of a first mutation to be able to put in “parent id” of the second mutation and so on… (This is to create a tree structure of parents / children)

Here is the code:, index) => {
              await this.$apollo.mutate({
                mutation: createAssetFolderMutation,
                variables: {
                  parentFolderId: this.parentFolderId,
                  slug: folderToCreate
                update: (store, info) => {
                  this.parentFolderId =

I think I have to use an asynchronous loop for Apollo mutations ?!

Thank you for your answers,