YABGSMS

Create a post

Creating a post with an admin token and its ID

You can run the following GraphQL query to create a post:

mutation CreatePost($author: Int!, $title: String!, $contentType: PostContentType!, $content: String!) {
  createPost(author: $author, title: $title, contentType: $contentType, content: $content) {
    id, title, author, content {
      type, data
    }
  }
}

which on success will generate an object akin to:

{
  "data": {
    "createPost": {
      "id": 21884,
      "title": "Hello World",
      "author": 1,
      "content": {
        "type": "TEXT",
        "data": "Hello, World!"
      }
    }
  }
}

Note

You can view how these IDs are generated at the Identifiers page