mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
add post query
This commit is contained in:
parent
5e30bfe2ed
commit
4d480d3130
@ -3,14 +3,42 @@ import gql from 'graphql-tag'
|
||||
// ------ mutations
|
||||
|
||||
export const createPostMutation = gql`
|
||||
mutation ($id: ID, $title: String!, $slug: String, $content: String!, $categoryIds: [ID]!) {
|
||||
CreatePost(id: $id, title: $title, slug: $slug, content: $content, categoryIds: $categoryIds) {
|
||||
mutation (
|
||||
$id: ID
|
||||
$title: String!
|
||||
$slug: String
|
||||
$content: String!
|
||||
$categoryIds: [ID]
|
||||
$groupId: ID
|
||||
) {
|
||||
CreatePost(
|
||||
id: $id
|
||||
title: $title
|
||||
slug: $slug
|
||||
content: $content
|
||||
categoryIds: $categoryIds
|
||||
groupId: $groupId
|
||||
) {
|
||||
id
|
||||
slug
|
||||
title
|
||||
content
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
// ------ queries
|
||||
|
||||
export const postQuery = () => {
|
||||
return gql`
|
||||
query Post($id: ID!) {
|
||||
Post(id: $id) {
|
||||
id
|
||||
title
|
||||
content
|
||||
}
|
||||
}
|
||||
`
|
||||
}
|
||||
|
||||
// fill queries in here
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user