ApolloClient with SSR

I recently came across an curious issue with ApolloClient on a server-side render. The GraphQL results wouldn’t update until I restarted the server.
In a client-side app, a new ApolloClient gets created for each page load. But in a node.js servic…


This content originally appeared on Welcome to my blog on Trys Mudford and was authored by Welcome to my blog on Trys Mudford

I recently came across an curious issue with ApolloClient on a server-side render. The GraphQL results wouldn’t update until I restarted the server. In a client-side app, a new ApolloClient gets created for each page load. But in a node.js service, it runs once on application launch and sits in memory till the whole application has been killed - that could be days or weeks. Not only that, as the server-side ApolloClient sits in memory, it’s shared between every user connection, and is therefore ripe for leaking data between connections.


This content originally appeared on Welcome to my blog on Trys Mudford and was authored by Welcome to my blog on Trys Mudford


Print Share Comment Cite Upload Translate Updates
APA

Welcome to my blog on Trys Mudford | Sciencx (2018-11-19T00:00:00+00:00) ApolloClient with SSR. Retrieved from https://www.scien.cx/2018/11/19/apolloclient-with-ssr/

MLA
" » ApolloClient with SSR." Welcome to my blog on Trys Mudford | Sciencx - Monday November 19, 2018, https://www.scien.cx/2018/11/19/apolloclient-with-ssr/
HARVARD
Welcome to my blog on Trys Mudford | Sciencx Monday November 19, 2018 » ApolloClient with SSR., viewed ,<https://www.scien.cx/2018/11/19/apolloclient-with-ssr/>
VANCOUVER
Welcome to my blog on Trys Mudford | Sciencx - » ApolloClient with SSR. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2018/11/19/apolloclient-with-ssr/
CHICAGO
" » ApolloClient with SSR." Welcome to my blog on Trys Mudford | Sciencx - Accessed . https://www.scien.cx/2018/11/19/apolloclient-with-ssr/
IEEE
" » ApolloClient with SSR." Welcome to my blog on Trys Mudford | Sciencx [Online]. Available: https://www.scien.cx/2018/11/19/apolloclient-with-ssr/. [Accessed: ]
rf:citation
» ApolloClient with SSR | Welcome to my blog on Trys Mudford | Sciencx | https://www.scien.cx/2018/11/19/apolloclient-with-ssr/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.