my graphql response payload is a very huge json object(1-80MB). So Instead of returning the json as response I am planning to store it in file. I m doing this in formatResponse of ApolloServer.
For small size file it is working but for big file it don’t. I am assuming this is because s3.upload is time taking process but fomatResponse finishes before uploading.
also formatResponse does not support async wait. so I cannot make code to wait the upload to finish.
I m not sure what is the best place to perform s3 upload to save my response as file.