mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
86 lines
1.1 KiB
JavaScript
86 lines
1.1 KiB
JavaScript
import gql from 'graphql-tag'
|
|
|
|
export const userFragment = lang => gql`
|
|
fragment user on User {
|
|
id
|
|
slug
|
|
name
|
|
avatar
|
|
disabled
|
|
deleted
|
|
shoutedCount
|
|
contributionsCount
|
|
commentedCount
|
|
followedByCount
|
|
followedByCurrentUser
|
|
location {
|
|
name: name${lang}
|
|
}
|
|
badges {
|
|
id
|
|
icon
|
|
}
|
|
}
|
|
`
|
|
|
|
export const postCountsFragment = gql`
|
|
fragment postCounts on Post {
|
|
commentsCount
|
|
shoutedCount
|
|
shoutedByCurrentUser
|
|
emotionsCount
|
|
}
|
|
`
|
|
export const postFragment = lang => gql`
|
|
${userFragment(lang)}
|
|
|
|
fragment post on Post {
|
|
id
|
|
title
|
|
content
|
|
contentExcerpt
|
|
createdAt
|
|
updatedAt
|
|
disabled
|
|
deleted
|
|
slug
|
|
image
|
|
language
|
|
checkedBlur
|
|
author {
|
|
...user
|
|
}
|
|
tags {
|
|
id
|
|
}
|
|
categories {
|
|
id
|
|
slug
|
|
name
|
|
icon
|
|
}
|
|
pinnedBy {
|
|
id
|
|
name
|
|
role
|
|
}
|
|
pinnedAt
|
|
}
|
|
`
|
|
export const commentFragment = lang => gql`
|
|
${userFragment(lang)}
|
|
|
|
fragment comment on Comment {
|
|
id
|
|
createdAt
|
|
updatedAt
|
|
disabled
|
|
deleted
|
|
content
|
|
contentExcerpt
|
|
author {
|
|
...user
|
|
}
|
|
}
|
|
`
|