graphql/graphql-update-post

Update Post

Update an existing post

graphql
post
mutation

Command

curl -X POST http://localhost:4000/graphql -H 'Content-Type: application/json' -d '{"query":"mutation { updatePost(id: 1, title: \"Updated Title\") { id title } }"}'

Explanation

Modifies an existing post. Useful for editing or correcting content.

Examples

Update content of post ID 5

mutation { updatePost(id: 5, content: \"New content\") { id content } }