Showing a message if a request is taking a long time
Hello, I'm trying to do something like show a message if a request (in this case, a mutation), is taking a long time.
This is what I have so far:
So far it seems to work. If the request is longer than 5s (in this case I'm faking an 8s request using the
typedMockRequest
function), it will create a toast using the show
method.
But it seems a little dirty and I'm not sure if there is a better approach to observing the total time a mutation or query is taking to fire off some sort of error message like this.0 Replies