Skip to content

Instantly share code, notes, and snippets.

@jgilbertcastro
Created November 15, 2019 14:49
Show Gist options
  • Save jgilbertcastro/ba67e8f2982c8f687e8ed526d736ec87 to your computer and use it in GitHub Desktop.
Save jgilbertcastro/ba67e8f2982c8f687e8ed526d736ec87 to your computer and use it in GitHub Desktop.
import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
//import apolloclient and vueapollo
import ApolloClient from "apollo-boost";
import VueApollo from "vue-apollo";
Vue.config.productionTip = false;
// define const apolloClient to set graphql api url
const apolloClient = new ApolloClient({
uri: "http://localhost:4000/graphql"
});
//add vueApollo plugin to global method
Vue.use(VueApollo);
const apolloProvider = new VueApollo({
defaultClient: apolloClient
});
new Vue({
router,
store,
render: h => h(App),
apolloProvider
}).$mount("#app");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment