I get this error when I include "Vue.use(VueApollo)" in my main.js
my apollo.js:
import Vue from "vue"
import VueApollo from "vue-apollo"
import { ApolloClient, createBatchingNetworkInterface } from "apollo-client"
Vue.use(VueApollo);
const apolloClient = new ApolloClient({
networkInterface: createBatchingNetworkInterface({
uri: "http://localhost:1234/graphql"
}),
connectToDevTools: true
});
let apollo = new VueApollo({
defaultClient: apolloClient
});
export default apollo
my main.js:
import Vue from "vue"
import App from "components/app"
import axios from "axios"
import router from "./router"
import apollo from "./apollo"
Vue.prototype.$http = axios;
const app = new Vue({
router,
apollo,
...App
});
export {
app,
apollo,
router
}
What am I doing wrong?
Notes:
I am using the latest version of all packages.
I already tried cleaning npm cache and reinstalling everything.
It should be apolloProvider:
const app = new Vue({
router,
apolloProvider: apollo,
...App
});
I am having the same issue, provide: apollo.provide() does not solve it
Most helpful comment
It should be
apolloProvider: