Start a conversation

Deleting Custom Entity and Field Definitions

You can remove Custom Entity and Field definitions in two ways: manually or by using a GraphQL mutation. This guide will explain how to proceed with both methods.

Deleting Custom Entity and Field Definitions Using GraphQL

If you choose to use GraphQL for deleting your Custom Entity and Field definitions, you need to make a GraphQL call. This call should target the deleteCustomFieldDefinitions mutation. This mutation removes the corresponding JSON files for the entity and field. After removal, these changes are committed to your Git repository for you.

Below is an example of a typical GraphQL call, including the specific query and the variables required to execute the call:

Mutation

fragment Error on Error {
    __typename
    message
    fields
}
 
mutation DeleteCustomFieldDefinitions(
    $fieldNames: [String!]!,
    $entityTypes: [EntityType!]!
) {
    deleteCustomFieldDefinitions(
        fieldNames: $fieldNames,
        entityTypes: $entityTypes
    ) {
        result
        errors {
            ...Error
            ...on CustomFieldDefinitionError {
                fieldName
            }
            ...on CustomFieldsEntityDefinitionError {
                entityType
            }
        }
    }
}

Variables

{
    "fieldNames" : [
        "v1testFloat",
        "v1testString"
    ],
    "entityTypes": [
        "TKB_ARTICLE",
        "FORUM",
        "COMMUNITY"
    ]  
}

Manually Deleting a Custom Entity Definition

If you need to delete a Custom Entity definition by hand, simply locate and remove the .entity.json file associated with the specific Custom Entity you wish to delete.

Manually Deleting a Custom Field Definition

When you want to delete a Custom Field definition manually, find and delete the .field.json file that corresponds to the specific Custom Field you're removing.

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. ATLAS

  2. Posted
  3. Updated

Comments