createComment

Create a comment on a Post

🔑 Requires authentication

This operation requires Bearer Token issued from our Authentication flow appended to the request headers. Please refer to Authentication page.

🚧 Only TEXT_ONLY PublicationContentType supported at this time

Interface

GraphQL Schema
input CommentCreateInput {
  profileId: String!
  publicationId: String!
  content: String!
  contentS3Uri: String!
  contentUri: String!
  primaryContentType: PublicationContentType!
  locale: String
}

type Mutation {
  createComment(input: CommentCreateInput!): Comment!
}

Request Input

CommentCreateInput object

  1. profileId: [Required]

  2. publicationsId: [Required] The postId of Post to be commented on

  3. content: [Optional] Text content of comment, must be provided if no media attached

    • Accepts escaped string

  4. contentS3Uri: [Required] Centralised storage URI of comment's content metadata

  5. contentUri: [Required] Decentralised storage URI of comment's content metadata

  6. primaryContentType: [Required] Refer to Publication Content Metadata

  7. locale: [Optional] ISO-639-1 representation of locale information

  8. appId: [Optional] Client executing Comment creation

Operation

GraphQL Operation
mutation CreateComment {
  createComment(
    input: {
      profileId: "0x24",
      publicationId: "0x2-0xa"
      content: "Lovely!!! 🤗",
      contentS3Uri: "https://nabi-protocol-profile-nft-meta.s3.amazonaws.com/ca7e400c-e83c-4ad3-85e4-ed3f0b0676b9.json",
      contentUri: "ar://eXcwlbsV1BiRGCsGKXa60Mj0i-xDZU0k95l_ysNwv_w/9276979d-53fe-4ce7-89a5-ab0d3292b489.json",
      locale: "US",
      primaryContentType: TEXT_ONLY
    }
  ) {
    id
    commentId
    profileId
    content
    contentS3Uri
    locale
    # ... any other Comment fields
  }
}

Response

JSON Response
{
  "data": {
    "createComment": {
      "id": "124",
      "commentId": null,
      "profileId": "0x13",
      "content": "Lovely!!! 🤗",
      "contentS3Uri": "https://nabi-protocol-profile-nft-meta.s3.amazonaws.com/ca7e400c-e83c-4ad3-85e4-ed3f0b0676b9.json",
      "locale": "US"
      // ... any other Comment fields
    }
  }
}

Last updated