Skip to content

Instantly share code, notes, and snippets.

@SaraVieira
Created March 31, 2018 20:29
Show Gist options
  • Save SaraVieira/ff6d3384a61beae0286a1a9b83edbe05 to your computer and use it in GitHub Desktop.
Save SaraVieira/ff6d3384a61beae0286a1a9b83edbe05 to your computer and use it in GitHub Desktop.
<script>
import { GET_NAMES, ADD_NAME } from "../queries";
export default {
name: "Form",
data() {
return {
person: ""
};
},
methods: {
onSubmit() {
const name = this.person;
this.person = "";
this.$apollo.mutate({
mutation: ADD_NAME,
variables: {
name
}
})
}
}
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment