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 // Paths
assetsRoot: path.resolve(__dirname, '../dist'), assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static', assetsSubDirectory: 'static',
assetsPublicPath: '/lunchrun-public/', assetsPublicPath: '/',
/** /**
* Source Maps * Source Maps

View File

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