Created
March 31, 2018 20:29
-
-
Save SaraVieira/ff6d3384a61beae0286a1a9b83edbe05 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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