Opigno Enterprise API provides the editCommunity mutation to update the community data.
The community can be edited only by the owner or a user associated wit the ADMINISTRATOR scope.
Community editing is implemented with a “patch” method. This means that only values that need to be updated should be sent.
Mutation accepts the following arguments:
| Argument | Type | Description |
|---|
communityId | ID | Required. ID of the community that should be updated. |
data | EditCommunityInput | Required. Contains the object with the community data that should be updated. |
| Parameter | Type | Description | Default |
|---|
title | String | The community title. Leave empty to keep it unchanged. | — |
description | String | The community description. Available HTML tags are: <br>, <p>, <h2>, <h3>, <h4>, <h5>, <h6>, <strong>, <em>, <u>, <s>, <sub>, <sup>, <a href>, <ul>, <ol start>, <li>. Any other tag will trimmed. Leave empty to keep it unchanged. | — |
visibility | CommunityVisibility | The community visibility. Leave empty to keep it unchanged. | — |
postNotificationEnabled | Boolean | A flag that indicates that a notification about a new post is enabled. Leave empty to keep it unchanged. | — |
imageBase64 | UploadedFileInput | The community image formatted as base64 string. Leave empty to keep it unchanged. | — |
removeImage | Boolean | Since image is the only optional property in Community object, it can be removed. To remove the image, set the value to true. | false |
mutation editCommunity {
editCommuntiy(
communityId: 2,
data: {
title: "The updated community title",
description: "<p>The updated community description.</p>",
visibility: PRIVATE
}
) {
errors
response {
id
title
visibility
description
created
image {
url
}
lastPostTime
membersNumber
postNotificationEnabled
}
}
}
The mutation returns a Community object. Detailed description and the full list of available properties can be found here.