Fluent Commerce Logo
Docs
Essential knowledge

Intended Audience:

Technical User

Author:

Kirill Gaiduk

Changed on:

20 Feb 2025

Overview

The `updateComment` Mutation allows for the updating of an existing Comment object.
PrerequisitesSpecific Permissions are required for updating Comments:
  • `COMMENT_UPDATE`
  • `COMMENT_VIEW`

Key points

  • Use the `updateComment` Mutation to update an existing Comment
  • Manage the Comment Permissions at the Account or Retailer level
  • Apply the "Retailer-specific Comment Permission Check" validation logic with the `fc.graphql.comment.access` Setting (`retailer` value)

Inputs

The Input fields for updating a Comment are defined with the `UpdateCommentInput`:
FieldTypeDescriptionNotes
`id`ID!Id of the Comment
`text`String!Comment textMax character limit: 200

Validation

Comment Permissions could be managed at the Account or Retailer level, which is controlled via the `fc.graphql.comment.access` Setting. The `retailer` Setting value enables the Retailer-specific access management, so the validation logic is applied to verify that your User has the correct rights to execute the `updateComment` Mutation - "Retailer-specific Comment Permission Check":
  • A target Comment is found by its Id (input)
  • A Comment Entity `retailerId` field stores a Retailer of the associated Entity
  • The Comment `retailerId` is compared to the querying User `retailerId` (defined with the User Role Context Id)
  • The Comment is updated upon the mentioned (User and Comment) `retailerId`'s match

Response

Sample Payload