Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fabis94 opened this issue Jul 16, 2021 · 6 comments
Open

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

fabis94 opened this issue Jul 16, 2021 · 6 comments

Comments

@fabis94
Copy link

fabis94 commented Jul 16, 2021

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 - Akryum/vue-cli-plugin-apollo#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

@negezor
Copy link
Contributor

negezor commented Jul 16, 2021

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

@fabis94
Copy link
Author

fabis94 commented Jul 16, 2021

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?

@negezor
Copy link
Contributor

negezor commented Jul 16, 2021

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
Copy link
Contributor

negezor commented Aug 31, 2021

@fabis94 fix for slow loading is quite easy. You just need to apply the fix from this vuejs/apollo#1241, I also described how to do it here.

@productdevbook
Copy link

@negezor vuejs/apollo#1241 fixed

@negezor
Copy link
Contributor

negezor commented Oct 14, 2021

@productfrontenddeveloper Yes, I'm already using 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants