What is the best approach to call query when they depend on scheduled functions?
useMutation from client where it inserts data in the db for that particular chat Id, and then run certain scheduled functions based on the data, and I am returning the chat Id to the client when the data has been inserted to the db.My application is working fine, but I feel like I am making unnecessary query requests, when all the scheduled functions have not yet been completed.
I am currently showing a loading state to the user till the embeddingId is undeifned, since the last scheduled function will populate the embeddingId.
Is this okay? Or is there a better way to achieve this?
Here is my code for inserting data to the db and calling the scheuled functions
The scheduled function is dependant on other scheduled functions.
