mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
Update vue-apollo
This commit is contained in:
parent
94d6bdc7b2
commit
ae4ecabce0
3
examples/vue-apollo/apollo/network-interfaces/default.js
Normal file
3
examples/vue-apollo/apollo/network-interfaces/default.js
Normal file
@ -0,0 +1,3 @@
|
||||
import { createNetworkInterface } from 'apollo-client'
|
||||
|
||||
export default createNetworkInterface({ uri: 'https://api.graph.cool/simple/v1/cj1dqiyvqqnmj0113yuqamkuu' })
|
@ -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'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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",
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user