Open fabis94 opened 3 years ago
There will be problems with the migration to Apollo 3 if the Composable API is used (I do not know how with Dollar Apollo). Slow loading occurs in SSR with requests in different components.
If you are not interested in SSR, then this completely works, here is a simple example code in the form of a plugin (the part with SSR can be cut, it also uses beforeSerialize
, which will only be in Nuxt 1.16 for the state used by hydration)
https://github.com/negezor/nuxt-apollo-3-slow-ssr/blob/master/plugins/apollo.js
SSR is a requirement for me, so it won't work for me, but thanks for the input. Can you elaborate on this?:
Slow loading occurs in SSR with requests in different components.
Why does this happen? And why does it only happen when the Composable API is used?
Why does this happen? And why does it only happen when the Composable API is used?
I tried to figure it out on my own, but it didn't work out for me. That's why I created this issue.
@fabis94 fix for slow loading is quite easy. You just need to apply the fix from this https://github.com/vuejs/vue-apollo/pull/1241, I also described how to do it here.
@negezor https://github.com/vuejs/vue-apollo/pull/1241 fixed
@productfrontenddeveloper Yes, I'm already using 😅
vue-cli-plugin-apollo relies on Apollo Client 2 which is an outdated version. Also it doesn't look like they're going to add Apollo Client 3 support anytime soon - https://github.com/Akryum/vue-cli-plugin-apollo/issues/441
So maybe this dependency can be removed and Apollo Client can be initialized manually?
P.S. I tried using https://cmty.app/nuxt/issues/new?repo=apollo-module to submit this issue, but the link doesn't work due to a DNS resolution error