Search code examples
graphqlapolloapollo-clientapollo-server

Is there any way to intentionally slow down GraphQL requests?


I'm working on a React app with data being pulled from my GraphQL API and I want to ensure the loading animations are working as intended. The problem is the requests are so quick in development that I only see a glimpse of the animation. I was wondering if there is any way to intentionally slow down requests to my localhost GraphQL server to simulate a poor connection, slow server etc.

I know that I could just hard code my loading animation to display but I want to simulate the actual use to see if it's all working correctly. This might be a very stupid and unnecessary thing to be asking. If so, just let me know.

For reference, I am using Apollo Client on the frontend and Apollo Express Server on the backend with Node.js.


Solution

  • Yes, you can go into the Network Tab in Chrome and then select No throttling and a dropdown with preset options you will see like Fast 3G, and Slow 3G. You can also add your Custom throttling setup where you can specify how many kbit/s you want to download.