Skip to content

Instantly share code, notes, and snippets.

@austinbv
Last active December 14, 2019 20:49
Show Gist options
  • Save austinbv/5eeec5b04bd13eb7a06b02fefecfea85 to your computer and use it in GitHub Desktop.
Save austinbv/5eeec5b04bd13eb7a06b02fefecfea85 to your computer and use it in GitHub Desktop.
Vue.extend({
$apollo: {
person: {
query: gql`query($id: ID!) {
person(id: $id) {
name
id
}
}`,
fetch-policy: 'network-only',
}
},
data() {
return {
person: {},
newPersonId: null,
}
},
methods: {
getNewPerson() {
this.$apollo.mutate({
mutation: gql`mutation($person: Person!) {
savePerson(person: $Person) {
person {
id
}
}
}`,
update: (store, { data }) {
////////////////////////////
// test-what-happens-here //
////////////////////////////
}
})
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment