Update vue-apollo

This commit is contained in:
Sebastien Chopin 2017-08-03 11:20:05 +02:00
parent 94d6bdc7b2
commit ae4ecabce0
7 changed files with 17 additions and 7 deletions

View File

@ -0,0 +1,3 @@
import { createNetworkInterface } from 'apollo-client'
export default createNetworkInterface({ uri: 'https://api.graph.cool/simple/v1/cj1dqiyvqqnmj0113yuqamkuu' })

View File

@ -1,8 +1,8 @@
module.exports = { module.exports = {
modules: ['@nuxtjs/apollo'], modules: ['@nuxtjs/apollo'],
apollo: { apollo: {
clients: { networkInterfaces: {
default: 'https://api.graph.cool/simple/v1/cj1dqiyvqqnmj0113yuqamkuu' default: '~/apollo/network-interfaces/default.js'
} }
} }
} }

View File

@ -1,8 +1,8 @@
{ {
"name": "nuxt-vue-apollo", "name": "nuxt-vue-apollo",
"dependencies": { "dependencies": {
"@nuxtjs/apollo": "^0.1.0", "@nuxtjs/apollo": "^1.0.0",
"nuxt": "^1.0.0-rc2" "nuxt": "^1.0.0-rc3"
}, },
"scripts": { "scripts": {
"dev": "nuxt", "dev": "nuxt",

View File

@ -8,7 +8,7 @@
</template> </template>
<script> <script>
import car from '~/queries/car' import car from '~/apollo/queries/car'
export default { export default {
apollo: { apollo: {
@ -29,8 +29,12 @@ export default {
}) })
return formatter.format(num) return formatter.format(num)
} }
},
head () {
return {
title: (this.Car ? `${this.Car.make} ${this.Car.model}` : 'Loading')
}
} }
} }
</script> </script>

View File

@ -12,7 +12,7 @@
</template> </template>
<script> <script>
import allCars from '~/queries/allCars' import allCars from '~/apollo/queries/allCars'
export default { export default {
apollo: { apollo: {
@ -20,6 +20,9 @@ export default {
prefetch: true, prefetch: true,
query: allCars query: allCars
} }
},
head: {
title: 'Cars with Apollo'
} }
} }
</script> </script>