diff --git a/webapp/graphql/PostQuery.js b/webapp/graphql/PostQuery.js new file mode 100644 index 000000000..240f718ae --- /dev/null +++ b/webapp/graphql/PostQuery.js @@ -0,0 +1,79 @@ +import gql from 'graphql-tag' + +export default i18n => { + const lang = i18n.locale().toUpperCase() + return gql(` + query Post($slug: String!) { + Post(slug: $slug) { + id + title + content + createdAt + disabled + deleted + slug + image + author { + id + slug + name + avatar + disabled + deleted + shoutedCount + contributionsCount + commentsCount + followedByCount + followedByCurrentUser + location { + name: name${lang} + } + badges { + id + key + icon + } + } + tags { + name + } + commentsCount + comments(orderBy: createdAt_desc) { + 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 + } + } + } + categories { + id + name + icon + } + shoutedCount + shoutedByCurrentUser + } + } + `) +} diff --git a/webapp/pages/post/_id/_slug/index.vue b/webapp/pages/post/_id/_slug/index.vue index 0019157c7..d5e79f4b8 100644 --- a/webapp/pages/post/_id/_slug/index.vue +++ b/webapp/pages/post/_id/_slug/index.vue @@ -62,8 +62,6 @@