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 = {
modules: ['@nuxtjs/apollo'],
apollo: {
clients: {
default: 'https://api.graph.cool/simple/v1/cj1dqiyvqqnmj0113yuqamkuu'
networkInterfaces: {
default: '~/apollo/network-interfaces/default.js'
}
}
}

View File

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

View File

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

View File

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