Skip to content

[Vue warn]: Injection "$apolloProvider" not found #231

Open
@tsy77

Description

@tsy77

const httpLink = new HttpLink({
// You should use an absolute URL here
uri: '/mis/server/graphql',
})

// Create the apollo client
const apolloClient = new ApolloClient({
link: httpLink,
cache: new InMemoryCache(),
connectToDevTools: true,
})

Vue.use(VueApollo);

const apolloProvider = new VueApollo({
defaultClient: apolloClient,
})
console.log(apolloProvider.provide())
new Vue({
el: '#app',
router,
provide: apolloProvider.provide(),
store,
filters,
render: h => h(App),
});

This is my usage, it looks like the document describes, but it is running with error "Injection "$apolloProvider" not found",is anyone experiencing the same problem?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions