add post query

This commit is contained in:
Moriz Wahl 2022-09-22 08:16:06 +02:00
parent 5e30bfe2ed
commit 4d480d3130

View File

@ -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