diff --git a/backend/src/db/graphql/posts.js b/backend/src/db/graphql/posts.js index 83f6cfb1a..bb7402a9f 100644 --- a/backend/src/db/graphql/posts.js +++ b/backend/src/db/graphql/posts.js @@ -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