mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
141 lines
2.7 KiB
JavaScript
141 lines
2.7 KiB
JavaScript
import gql from 'graphql-tag'
|
|
|
|
export default () => {
|
|
return {
|
|
CreatePost: gql`
|
|
mutation(
|
|
$title: String!
|
|
$content: String!
|
|
$language: String
|
|
$categoryIds: [ID]
|
|
$imageUpload: Upload
|
|
$blurImage: Boolean
|
|
$imageAspectRatio: Float
|
|
) {
|
|
CreatePost(
|
|
title: $title
|
|
content: $content
|
|
language: $language
|
|
categoryIds: $categoryIds
|
|
imageUpload: $imageUpload
|
|
blurImage: $blurImage
|
|
imageAspectRatio: $imageAspectRatio
|
|
) {
|
|
title
|
|
slug
|
|
content
|
|
contentExcerpt
|
|
language
|
|
blurImage
|
|
}
|
|
}
|
|
`,
|
|
UpdatePost: gql`
|
|
mutation(
|
|
$id: ID!
|
|
$title: String!
|
|
$content: String!
|
|
$language: String
|
|
$imageUpload: Upload
|
|
$categoryIds: [ID]
|
|
$image: String
|
|
$blurImage: Boolean
|
|
$imageAspectRatio: Float
|
|
) {
|
|
UpdatePost(
|
|
id: $id
|
|
title: $title
|
|
content: $content
|
|
language: $language
|
|
imageUpload: $imageUpload
|
|
categoryIds: $categoryIds
|
|
image: $image
|
|
blurImage: $blurImage
|
|
imageAspectRatio: $imageAspectRatio
|
|
) {
|
|
id
|
|
title
|
|
slug
|
|
content
|
|
contentExcerpt
|
|
language
|
|
blurImage
|
|
pinnedBy {
|
|
id
|
|
name
|
|
role
|
|
}
|
|
imageAspectRatio
|
|
}
|
|
}
|
|
`,
|
|
DeletePost: gql`
|
|
mutation($id: ID!) {
|
|
DeletePost(id: $id) {
|
|
id
|
|
}
|
|
}
|
|
`,
|
|
AddPostEmotionsMutation: gql`
|
|
mutation($to: _PostInput!, $data: _EMOTEDInput!) {
|
|
AddPostEmotions(to: $to, data: $data) {
|
|
emotion
|
|
from {
|
|
id
|
|
}
|
|
to {
|
|
id
|
|
}
|
|
}
|
|
}
|
|
`,
|
|
RemovePostEmotionsMutation: gql`
|
|
mutation($to: _PostInput!, $data: _EMOTEDInput!) {
|
|
RemovePostEmotions(to: $to, data: $data) {
|
|
emotion
|
|
from {
|
|
id
|
|
}
|
|
to {
|
|
id
|
|
}
|
|
}
|
|
}
|
|
`,
|
|
pinPost: gql`
|
|
mutation($id: ID!) {
|
|
pinPost(id: $id) {
|
|
id
|
|
title
|
|
slug
|
|
content
|
|
contentExcerpt
|
|
language
|
|
pinnedBy {
|
|
id
|
|
name
|
|
role
|
|
}
|
|
}
|
|
}
|
|
`,
|
|
unpinPost: gql`
|
|
mutation($id: ID!) {
|
|
unpinPost(id: $id) {
|
|
id
|
|
title
|
|
slug
|
|
content
|
|
contentExcerpt
|
|
language
|
|
pinnedBy {
|
|
id
|
|
name
|
|
role
|
|
}
|
|
}
|
|
}
|
|
`,
|
|
}
|
|
}
|