Custom fields can be added to Core Node Types either through the Aurora UI or by using the create and update mutations detailed in the sections below:
Core Node Create Mutations
createCategory
The createCategory
mutation example below creates a new category with custom fields.
mutation CreateCategoryInformation($file: CreateCategoryInput!) {
createCategory(createInput: $file) {
result {
id
displayId
nodeType
title
customFields {
...CustomFieldView
}
}
errors {
...Error
... on GreaterThanMaxValueError {
max
}
}
}
}
fragment Error on Error {
message
fields
}
fragment CustomFieldView on CustomField {
name
... on CustomBooleanField {
booleanValue
}
... on CustomStringField {
stringValue
}
... on CustomIntField {
intValue
}
... on CustomLongField {
longValue
}
... on CustomFloatField {
floatValue
}
... on CustomDateTimeField {
dateTimeValue
}
... on CustomStringListField {
stringListValue
}
... on CustomIntListField {
intListValue
}
... on CustomFloatListField {
floatListValue
}
}
{
"file": {
"id": "category:test44",
"title": "category-44",
"description": "Category Description",
"customFields": [
{
"name": "v2testString",
"value": "New testString value66"
},
{
"name": "v2testInt",
"value": "190"
},
{
"name": "v2testIntList",
"value": "1,2,3,4,5,6,7,866"
},
{
"name": "v2testFloat",
"value": "2.566"
},
{
"name": "v2testFloatList",
"value": "0.5,1.0,1.5,2.0,2.5,3.066"
},
{
"name": "v2testLong",
"value": "2695137"
},
{
"name": "streamingService",
"value": "Streaming Service new value"
},
{
"name": "lastWatchDate",
"value": null
}
]
}
}
createGroupHub
The createGroupHub
mutation example below creates a new GroupHub with custom fields.
mutation CreateGroupHubInformation($file: CreateGroupHubInput!) {
createGroupHub(createInput: $file) {
result {
id
displayId
nodeType
title
customFields {
...CustomFieldView
}
descendants {
edges {
node {
displayId
title
... on Board {
conversationStyle
__typename
}
__typename
}
__typename
}
__typename
}
__typename
}
errors {
...Error
... on GreaterThanMaxValueError {
max
__typename
}
__typename
}
__typename
}
}
fragment Error on Error {
message
fields
__typename
}
fragment CustomFieldView on CustomField {
name
... on CustomBooleanField {
booleanValue
}
... on CustomStringField {
stringValue
}
... on CustomIntField {
intValue
}
... on CustomLongField {
longValue
}
... on CustomFloatField {
floatValue
}
... on CustomDateTimeField {
dateTimeValue
}
... on CustomStringListField {
stringListValue
}
... on CustomIntListField {
intListValue
}
... on CustomFloatListField {
floatListValue
}
}
{
"file": {
"avatar": null,
"id": "grouphub:group-112",
"title": "Group-112",
"description": "",
"membershipType": "OPEN",
"boards": {
"items": [
{
"conversationStyle": "FORUM",
"title": "Group-Forum-112",
"id": "group-forum-112"
}
]
},
"customFields": [
{
"name": "v2testString",
"value": "New testString value66"
},
{
"name": "v2testInt",
"value": "190"
},
{
"name": "v2testIntList",
"value": "1,2,3,4,5,6,7,866"
},
{
"name": "v2testFloat",
"value": "2.566"
},
{
"name": "v2testFloatList",
"value": "0.5,1.0,1.5,2.0,2.5,3.066"
},
{
"name": "v2testLong",
"value": "2695137"
},
{
"name": "streamingService",
"value": "Streaming Service new value"
},
{
"name": "lastWatchDate",
"value": null
}
]
}
}
createBoard
The createBoard
mutation example below creates a new board with forum/blog/TKB.
mutation CreateBoardInformation($file: CreateBoardInput!) {
createBoard(createInput: $file) {
result {
id
displayId
conversationStyle
title
customFields {
...CustomFieldView
}
__typename
}
errors {
...Error
... on GreaterThanMaxValueError {
max
__typename
}
__typename
}
__typename
}
}
fragment Error on Error {
message
fields
__typename
}
fragment CustomFieldView on CustomField {
name
... on CustomBooleanField {
booleanValue
}
... on CustomStringField {
stringValue
}
... on CustomIntField {
intValue
}
... on CustomLongField {
longValue
}
... on CustomFloatField {
floatValue
}
... on CustomDateTimeField {
dateTimeValue
}
... on CustomStringListField {
stringListValue
}
... on CustomIntListField {
intListValue
}
... on CustomFloatListField {
floatListValue
}
}
{
"file": {
"avatar": null,
"id": "FORUM:ForumBoard-7",
"title": "Forum-122",
"description": "",
"conversationStyle": "FORUM",
"tagType": "PRESET_ONLY",
"requireTags": false,
"predefinedTags": "",
"customFields": [
{
"name": "v2testString",
"value": "New testString value66"
},
{
"name": "v2testInt",
"value": "190"
},
{
"name": "v2testIntList",
"value": "1,2,3,4,5,6,7,866"
},
{
"name": "v2testFloat",
"value": "2.566"
},
{
"name": "v2testFloatList",
"value": "0.5,1.0,1.5,2.0,2.5,3.066"
},
{
"name": "v2testLong",
"value": "2695137"
},
{
"name": "streamingService",
"value": "Streaming Service new value"
},
{
"name": "lastWatchDate",
"value": null
}
]
}
}
Core Node Update using Aurora UI
The Settings Admin will display a section for Custom Settings if any custom fields have been configured to be updatable via the UI:
To ensure a field appears in the Custom Fields section of the Settings Admin, it needs to be correctly configured as follows:
- The updatable setting for the field must be marked as YES or REQUIRED.
- For the access > write setting, choose PUBLIC to allow anyone to modify the field, or PRIVATE if only the user should have this ability.
- A common setup for user profile fields visible to all is to set access > read to
PUBLIC
(making the field visible to everyone) and access > write toPRIVATE
(so only the user can make changes).
- A common setup for user profile fields visible to all is to set access > read to
- The field's valueDefinition > valueType must be one of the following: BOOLEAN, DATETIME, FLOAT, INT, LONG, or STRING. Note that list types (LIST_FLOAT, LIST_INT, LIST_STRING) currently cannot be configured via the UI.
- The valueDefinition > updateEntityFormField must specify a valid form control.
- Add the field name to the customFieldNames in the .entity.json file corresponding to the
EntityType
of the Core Node you're altering. For instance, for editing a Category, the field name must be listed in thecustomFieldNames
in category.entity.json.
To access the Custom Settings for a Core Node, head over to the Community Structure page. Locate the Core Node you wish to modify, click on the gear icon (Edit Place), then press Edit. If any custom fields are set as updatable and are linked to the Core Node Type of the node you're editing, a Custom Settings link will be visible on the left.
Core Node Update Mutations
updateCommunity
The updateCommunity
mutation example below updates the community with Custom Fields.
mutation UpdateCommunity($updateCommunityInput: UpdateCommunityInput!) {
updateCommunity(updateInput: $updateCommunityInput) {
result {
id
title
customFields {
...CustomFieldView
}
}
errors {
...Error
... on GreaterThanMaxValueError {
max
}
}
}
}
fragment Error on Error {
message
fields
}
fragment CustomFieldView on CustomField {
name
... on CustomBooleanField {
booleanValue
}
... on CustomStringField {
stringValue
}
... on CustomIntField {
intValue
}
... on CustomLongField {
longValue
}
... on CustomFloatField {
floatValue
}
... on CustomDateTimeField {
dateTimeValue
}
... on CustomStringListField {
stringListValue
}
... on CustomIntListField {
intListValue
}
... on CustomFloatListField {
floatListValue
}
}
{
"updateCommunityInput": {
"title": "lia",
"customFields": [
{
"name": "v2testString",
"value": "New testString value updates"
},
{
"name": "v2testInt",
"value": "190"
},
{
"name": "v2testIntList",
"value": "1,2,3,4,5,6,7,866"
},
{
"name": "v2testFloat",
"value": "2.566"
},
{
"name": "v2testFloatList",
"value": "0.5,1.0,1.5,2
ATLAS
Comments