Slide 16
Slide 16 text
Vue.js + Vuex + vue-apollo
export const GET_USER = gql`
query{
User(id: "cjdg6asik018w0152p0m3t2r7") {
id
name
posts {
id
type
minutes
memo
}
}
}
`
created: function () {
this.$apollo.query({
query: GET_USER,
}).then(data => {
this.$store.commit('updateUser', data.data.User);
})
},