docs: Fix an error in the mutations documentation (#390)

This commit is contained in:
Ramon Wenger
2018-09-13 19:11:27 +02:00
committed by Guillaume Chau
parent 15bb0f732e
commit 94e434f44b
+2 -2
View File
@@ -33,11 +33,11 @@ methods: {
// Update the cache with the result
// The query will be updated with the optimistic response
// and then with the real result of the mutation
update: (store, { data: { newTag } }) => {
update: (store, { data: { addTag } }) => {
// Read the data from our cache for this query.
const data = store.readQuery({ query: TAGS_QUERY })
// Add our tag from the mutation to the end
data.tags.push(newTag)
data.tags.push(addTag)
// Write our data back to the cache.
store.writeQuery({ query: TAGS_QUERY, data })
},