Update the contentExcerpt

Co-Authored-By: mattwr18 <mattwr18@gmail.com>
This commit is contained in:
Wolfgang Huß 2019-07-16 15:48:38 +02:00
parent e4fd7f4cf7
commit 3b88c47206
4 changed files with 24 additions and 19 deletions

View File

@ -27,6 +27,7 @@
import gql from 'graphql-tag'
import HcEditor from '~/components/Editor/Editor'
import { mapMutations } from 'vuex'
import CommentMutations from '~/graphql/CommentMutations.js'
export default {
components: {
@ -67,14 +68,7 @@ export default {
this.disabled = true
this.$apollo
.mutate({
mutation: gql`
mutation($content: String!, $id: ID!) {
UpdateComment(content: $content, id: $id) {
id
content
}
}
`,
mutation: CommentMutations().UpdateComment,
variables: {
content: this.form.content,
id: this.comment.id,
@ -96,12 +90,14 @@ export default {
apollo: {
User: {
query() {
return gql(`{
User(orderBy: slug_asc) {
id
slug
return gql`
{
User(orderBy: slug_asc) {
id
slug
}
}
}`)
`
},
result({ data: { User } }) {
this.users = User

View File

@ -20,5 +20,14 @@ export default () => {
}
}
`,
UpdateComment: gql`
mutation($content: String!, $id: ID!) {
UpdateComment(content: $content, id: $id) {
id
content
contentExcerpt
}
}
`,
}
}

View File

@ -2,7 +2,7 @@ import gql from 'graphql-tag'
export default app => {
const lang = app.$i18n.locale().toUpperCase()
return gql(`
return gql`
query Comment($postId: ID) {
Comment(postId: $postId) {
id
@ -30,5 +30,5 @@ export default app => {
}
}
}
`)
`
}

View File

@ -2,7 +2,7 @@ import gql from 'graphql-tag'
export default i18n => {
const lang = i18n.locale().toUpperCase()
return gql(`
return gql`
query Post($slug: String!) {
Post(slug: $slug) {
id
@ -73,12 +73,12 @@ export default i18n => {
shoutedByCurrentUser
}
}
`)
`
}
export const filterPosts = i18n => {
const lang = i18n.locale().toUpperCase()
return gql(`
return gql`
query Post($filter: _PostFilter, $first: Int, $offset: Int) {
Post(filter: $filter, first: $first, offset: $offset) {
id
@ -118,5 +118,5 @@ export const filterPosts = i18n => {
shoutedCount
}
}
`)
`
}