#Multiple instances for ApolloClient?

1 messages · Page 1 of 1 (latest)

silver robin
mellow shuttle
#

To me it seems like the Apollo client is half a front end framework for like react fetching. If that’s the case, you don’t need to worry about the global. Since it seems your front end is responsible for creating an instance on each user.

silver robin
mellow shuttle
#

If you’re doing it on the server the global may make sense. You can experiment and try without it first. The issue the global is trying to resolve is many many clients being made and just floating. You’ll notice your application can start slowing down as you open more and more clients for each time you make a code change. If you see more resources getting used or if you see warnings from the library itself, then definitely go with the global implementation

#

If you were to kill the process though your next dev start will be fresh and shouldn’t have any issues. So the worst case is you notice performance issues only in development without the global