mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
- Add pin/unpin post to content menu - Update apollo cache to reactively unpin - Update apollo cache in root path to re-order Posts - Order with pinned post first - Start setting up filters, so that the pinned post is always the first post visible
100 lines
1.9 KiB
JavaScript
100 lines
1.9 KiB
JavaScript
import gql from 'graphql-tag'
|
|
|
|
export default () => {
|
|
return {
|
|
CreatePost: gql`
|
|
mutation(
|
|
$title: String!
|
|
$content: String!
|
|
$language: String
|
|
$categoryIds: [ID]
|
|
$imageUpload: Upload
|
|
) {
|
|
CreatePost(
|
|
title: $title
|
|
content: $content
|
|
language: $language
|
|
categoryIds: $categoryIds
|
|
imageUpload: $imageUpload
|
|
) {
|
|
title
|
|
slug
|
|
content
|
|
contentExcerpt
|
|
language
|
|
}
|
|
}
|
|
`,
|
|
UpdatePost: gql`
|
|
mutation(
|
|
$id: ID!
|
|
$title: String!
|
|
$content: String!
|
|
$language: String
|
|
$imageUpload: Upload
|
|
$categoryIds: [ID]
|
|
$image: String
|
|
$pinned: Boolean
|
|
$unpinned: Boolean
|
|
) {
|
|
UpdatePost(
|
|
id: $id
|
|
title: $title
|
|
content: $content
|
|
language: $language
|
|
imageUpload: $imageUpload
|
|
categoryIds: $categoryIds
|
|
image: $image
|
|
pinned: $pinned
|
|
unpinned: $unpinned
|
|
) {
|
|
id
|
|
title
|
|
slug
|
|
content
|
|
contentExcerpt
|
|
language
|
|
pinnedBy {
|
|
id
|
|
name
|
|
role
|
|
}
|
|
}
|
|
}
|
|
`,
|
|
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
|
|
}
|
|
}
|
|
}
|
|
`,
|
|
}
|
|
}
|