graphql/graphql-add-post

Add Post

Create a new post via mutation

graphql
post
mutation

Command

curl -X POST http://localhost:4000/graphql -H 'Content-Type: application/json' -d '{"query":"mutation { addPost(title: \"New Post\", content: \"Content here\", authorId: 1) { id title } }"}'

Explanation

Creates a new post object in the system. Useful for blog platforms or content management.

Examples

Add new post by author 2

mutation { addPost(title: \"Hello\", content: \"World\", authorId: 2) { id title } }