-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
I cannot build a Web-Component that includes vue-apollo client #4555
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
Comments
The apolloProvider is not part of The thing is, the apolloProvider is injected into the root instance of an app, and child components can access it through an injection/global mixin. However, even if used inside of a Vue app that has an apolloPropvider, your Vue component that is wrapped in a web component doesn't have access to these injected properties since there's not $parent. (Additionally, no apolloProvider related code is even accessed in that component or its child components, so I'm not sure how you expect the graphql query to be triggered) in short: web components should not depend on framework-specific side-effects like injections of dependencies. they should be totally independent. You will have to include the apolloProvider in |
Thanks @LinusBorg Apologies, I should have linked to https://github.com/datacite/spitz/tree/1b2eb869abdcc2bb9e596c4f61bd791cc2b2432a
Well |
I would think in const apolloProvider = new VueApollo({
defaultClient: apolloClient,
})
export default {
name: 'BaseWidget',
apolloProvider,
components:{
//.... |
Aynway, this is not a support forum so until you figure out that this is a bug and not an unclear usage scenario of a plugin, please use the forums and other dedicated channels to ask for support. forum.vuejs.org |
Version
3.10.0
Reproduction link
https://github.com/datacite/spitz
Environment info
Steps to reproduce
In essence, the building process does not include the
apolloProvider
into the Web Component.What is expected?
I expect the building process to pass apolloProvider to the web component.
What is actually happening?
The building process is not including apolloProvider and thuse the web component does not execute the graphQL query
The text was updated successfully, but these errors were encountered: