Create run mutation

This commit is contained in:
Ben Ramey
2018-06-03 14:08:30 -05:00
committed by benjaminramey
parent cc42106fdf
commit cc477a03d2
3 changed files with 10 additions and 11 deletions

View File

@@ -50,7 +50,7 @@ module.exports = {
// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/lunchrun-public/',
assetsPublicPath: '/',
/**
* Source Maps

View File

@@ -17,8 +17,8 @@
</template>
<script>
import gql from 'graphql-tag'
import listRuns from '../queries/listRuns'
import createRun from '../mutations/createRun'
export default {
name: 'Start',
data () {
@@ -30,16 +30,9 @@ export default {
addRun () {
const name = this.name
this.$apollo.mutate({
mutation: gql`mutation ($name: String!) {
createRun(input: { id: 1, name: $name }) {
id, name
}
}`,
mutation: createRun,
variables: {
name: name
},
update: (store, { data: { newRun } }) => {
}
}).then((data) => {
console.log(data)

View File

@@ -0,0 +1,6 @@
import gql from 'graphql-tag'
export default gql`mutation ($name: String!) {
createRun(input: { name: $name }) {
id, name
}
}`