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

Support for defining custom links #563

Open
bmulholland opened this issue Nov 1, 2023 · 5 comments
Open

Support for defining custom links #563

bmulholland opened this issue Nov 1, 2023 · 5 comments

Comments

@bmulholland
Copy link

bmulholland commented Nov 1, 2023

Your use case

We're upgrading to Nuxt 3 from Nuxt 2. When upgrading Nuxt Apollo, I see there's no longer any way to pass in our custom ApolloLink. We already had this working using a complex link chain, which supports both file uploads (ref: #553) but also has a custom link for websockets via Rails Action Cable.

Removing this option is backwards-incompatible. We'll have to do the same as others and write our own plugin, I guess. Then we'll have to maintain that ourselves, too, which I prefer not to do.

The solution you'd like

Allow overriding links, like used to be available.

Possible alternatives

No response

Additional information

No response

@ashotmark
Copy link

hi @bmulholland ,
I had same issue in the project that I work.
in the project, We used nuxt3 and nuxt apllo (this module).
We need to have custom link for to add support csrf link for security and pusher based subscription for real time data.
I went through documentation and source code and realized that there is no way to have custom link by config or plugin that this module exposed so far.
As a solution, I had to fork repo and changed source code to support custom link as our needs and published into own npm.
So this could work in our project, please let me know if you have more questions.
Thank you

@bmulholland
Copy link
Author

bmulholland commented Dec 11, 2023

Thanks for the idea, Ashot :). On my end, I ended up just dropping Nuxt Apollo and configuring it directly myself. That was easy because we don't use SSR.

@ashotmark
Copy link

ashotmark commented Dec 11, 2023

Got you, as long as not SSR, no need to use nuxt apollo, and I am sure that your solution is the best.
thanks for reply, hope all good 👍

@rschmied
Copy link

rschmied commented Dec 18, 2023

Hey Brendan -- are you then using https://github.com/Akryum/vue-cli-plugin-apollo direct? I am in the same boat but ended up writing a plugin which works around this limitation but still using the module (to some extent). It works but I have the feeling that it's not needed as I have deviated far enough from the "simple" use case of the nuxt module.

@bmulholland
Copy link
Author

I'm on Vue 3/Vite now, which drops Vue CLI support, so it's https://github.com/vuejs/apollo directly.

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

No branches or pull requests

3 participants