mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
- was throwing an error when trying to update commentsCount because of new implementation by @roschaefer which uses countResolver, but there was no related for commentsCount, it was r... also commentsCount is no longer needed anywhere in the code base, it is commentedCount now
131 lines
2.6 KiB
JavaScript
131 lines
2.6 KiB
JavaScript
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
|
|
commentedCount
|
|
followedByCount
|
|
followedByCurrentUser
|
|
location {
|
|
name: name${lang}
|
|
}
|
|
badges {
|
|
id
|
|
icon
|
|
}
|
|
}
|
|
tags {
|
|
name
|
|
}
|
|
comments(orderBy: createdAt_asc) {
|
|
id
|
|
contentExcerpt
|
|
content
|
|
createdAt
|
|
disabled
|
|
deleted
|
|
author {
|
|
id
|
|
slug
|
|
name
|
|
avatar
|
|
disabled
|
|
deleted
|
|
shoutedCount
|
|
contributionsCount
|
|
commentedCount
|
|
followedByCount
|
|
followedByCurrentUser
|
|
location {
|
|
name: name${lang}
|
|
}
|
|
badges {
|
|
id
|
|
icon
|
|
}
|
|
}
|
|
}
|
|
categories {
|
|
id
|
|
name
|
|
icon
|
|
}
|
|
shoutedCount
|
|
shoutedByCurrentUser
|
|
emotionsCount
|
|
}
|
|
}
|
|
`
|
|
}
|
|
|
|
export const filterPosts = i18n => {
|
|
const lang = i18n.locale().toUpperCase()
|
|
return gql`
|
|
query Post($filter: _PostFilter, $first: Int, $offset: Int, $orderBy: [_PostOrdering]) {
|
|
Post(filter: $filter, first: $first, offset: $offset, orderBy: $orderBy) {
|
|
id
|
|
title
|
|
contentExcerpt
|
|
createdAt
|
|
disabled
|
|
deleted
|
|
slug
|
|
image
|
|
author {
|
|
id
|
|
avatar
|
|
slug
|
|
name
|
|
disabled
|
|
deleted
|
|
contributionsCount
|
|
shoutedCount
|
|
commentedCount
|
|
followedByCount
|
|
followedByCurrentUser
|
|
location {
|
|
name: name${lang}
|
|
}
|
|
badges {
|
|
id
|
|
icon
|
|
}
|
|
}
|
|
categories {
|
|
id
|
|
name
|
|
icon
|
|
}
|
|
shoutedCount
|
|
}
|
|
}
|
|
`
|
|
}
|
|
|
|
export const PostsEmotionsByCurrentUser = () => {
|
|
return gql`
|
|
query PostsEmotionsByCurrentUser($postId: ID!) {
|
|
PostsEmotionsByCurrentUser(postId: $postId)
|
|
}
|
|
`
|
|
}
|