apollo
apollo copied to clipboard
With SSR, the same requests in different components result in slow or endless loading
Describe the bug The same request in different components results in infinite or slow page loading.
To Reproduce Steps to reproduce the behavior:
- Go to 'https://codesandbox.io/s/github/negezor/nuxt-apollo-3-slow-ssr'
- Reload page in
Slow SSR Example
- Watch endless loading
Expected behavior
The page loads as fast as on Fast SSR Example
Versions
vue: 2.6.14
nuxt: like 2.16, but nuxt-edge
@vue/apollo-composable: 4.0.0-alpha.12
@apollo/client: 3.3.21
Additional context
Everything works on apollo-client@2
, but if you migrate the client to apollo-client@3
, this strange behavior occurs. I checked it on my production project, the only thing that changed is that it takes ~10 seconds to load from SSR. In different components I call the useViewer()
hook which in the apollo cache contains the request from query { viewer { id username permissions } }
I've experienced same issues with latest apollo and vue apollo, 2 simple SSR queries takes over 15 seconds to load page.