Nuxt/examples/vue-apollo/plugins/apollo.js

24 lines
531 B
JavaScript
Raw Normal View History

2017-04-14 10:52:27 +00:00
import 'babel-polyfill'
import Vue from 'vue'
import VueApollo from 'vue-apollo'
import { ApolloClient, createNetworkInterface } from 'apollo-client'
const API_ENDPOINT = 'https://api.graph.cool/simple/v1/cj1dqiyvqqnmj0113yuqamkuu'
const apolloClient = new ApolloClient({
networkInterface: createNetworkInterface({
uri: API_ENDPOINT,
transportBatching: true
})
})
const apolloProvider = new VueApollo({
defaultClient: apolloClient
})
2017-07-26 09:27:59 +00:00
Vue.use(VueApollo)
Vue.mixin({apolloProvider})
2017-04-14 10:52:27 +00:00
export default apolloProvider