const promises = photos . map ( async ( photo : any ) => { const deleteResult : any = await query ( gql ` mutation { deletePhoto ( id : "${ photo .id}" ) } `) count += 1 }) await Promise . all ( promises )