query and mutations are functions

This commit is contained in:
Moriz Wahl 2022-10-03 22:41:25 +02:00
parent 5f4d7c2bf3
commit abcfe259a0

View File

@ -2,30 +2,32 @@ import gql from 'graphql-tag'
// ------ mutations
export const createPostMutation = gql`
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
export const createPostMutation = () => {
return gql`
mutation (
$id: ID
$title: String!
$slug: String
$content: String!
$categoryIds: [ID]
$groupId: ID
) {
id
slug
title
content
CreatePost(
id: $id
title: $title
slug: $slug
content: $content
categoryIds: $categoryIds
groupId: $groupId
) {
id
slug
title
content
}
}
}
`
`
}
// ------ queries