apollo icon indicating copy to clipboard operation
apollo copied to clipboard

Get rid of vue-cli-plugin-apollo as it uses Apollo Client 2

Open fabis94 opened this issue 4 years ago • 6 comments

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

fabis94 avatar Jul 16 '21 10:07 fabis94

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

negezor avatar Jul 16 '21 10:07 negezor

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?

fabis94 avatar Jul 16 '21 10:07 fabis94

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.

negezor avatar Jul 16 '21 11:07 negezor

@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 avatar Aug 31 '21 19:08 negezor

@negezor https://github.com/vuejs/vue-apollo/pull/1241 fixed

productdevbook avatar Oct 14 '21 12:10 productdevbook

@productfrontenddeveloper Yes, I'm already using 😅

negezor avatar Oct 14 '21 12:10 negezor