Ocelot-Social/webapp/graphql/PostCommentsQuery.js
Matt Rider c6203ad8eb Refactor CreateComments functionality
- update apollo cache on successful mutation
- remove global event listener
- avoid refetch Post to update CommentsList
- return comment with its author from resolver
2019-06-24 18:21:52 -03:00

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
}
}
}
}
}
`)
}