vuejs / apollo

🚀 Apollo/GraphQL integration for VueJS
http://apollo.vuejs.org
MIT License
6.03k stars 522 forks source link

With SSR, the same requests in different components result in slow or endless loading #1222

Open negezor opened 3 years ago

negezor commented 3 years ago

Describe the bug The same request in different components results in infinite or slow page loading.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://codesandbox.io/s/github/negezor/nuxt-apollo-3-slow-ssr'
  2. Reload page in Slow SSR Example
  3. 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 } }

xxSkyy commented 2 years ago

I've experienced same issues with latest apollo and vue apollo, 2 simple SSR queries takes over 15 seconds to load page.