Skip to content

Instantly share code, notes, and snippets.

Created Sep 21, 2016
What would you like to do?
vue-apollo configuration and app startup
import Vue from 'vue';
import App from './App.vue';
import ApolloClient, { createNetworkInterface, addTypename } from 'apollo-client';
import VueApollo from 'vue-apollo';
// Create the apollo client
const apolloClient = new ApolloClient({
networkInterface: createNetworkInterface({
uri: 'http://localhost:8080/graphql',
transportBatching: true,
queryTransformer: addTypename,
dataIdFromObject: r =>,
// Install the vue plugin
// With the apollo client instance
Vue.use(VueApollo, {
// Start the Vue app
new Vue({
el: '#app',
render: h => h(App)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment