mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
- update apollo cache on successful mutation - remove global event listener - avoid refetch Post to update CommentsList - return comment with its author from resolver
40 lines
784 B
JavaScript
40 lines
784 B
JavaScript
import gql from 'graphql-tag'
|
|
|
|
export default i18n => {
|
|
const lang = i18n.locale().toUpperCase()
|
|
return gql(`
|
|
query Post($slug: String!) {
|
|
Post(slug: $slug) {
|
|
comments(orderBy: createdAt_asc) {
|
|
id
|
|
contentExcerpt
|
|
createdAt
|
|
disabled
|
|
deleted
|
|
author {
|
|
id
|
|
slug
|
|
name
|
|
avatar
|
|
disabled
|
|
deleted
|
|
shoutedCount
|
|
contributionsCount
|
|
commentsCount
|
|
followedByCount
|
|
followedByCurrentUser
|
|
location {
|
|
name: name${lang}
|
|
}
|
|
badges {
|
|
id
|
|
key
|
|
icon
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`)
|
|
}
|