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