Class RevisionTrait

The revision trait is used to enable the entity its attached to, to track any changes to it by creating a copy of the original entity before updating it. Conditions property allows to skip revision creation if it's not required

Usage:

traits:
- type: revision
revision_properties:
- name: revisionMessage
type: String
relationships:
- relationship: hasProfileImage
- vertex: MediaFile
- direction: out
conditions:
operator: and
statements:
- property: state
operator: equal
operand: published
listen_properties_changes:
- title
- data
- state
limit:
- change_type: major
value: 10
- change_type: minor
value: 10

Hierarchy

Constructors

Properties

Trait instance configuration.

_global: boolean = false

Whether this is a global (not bound to any specific schema item) trait instance.

_type?: "revision"

Trait type.

Methods

  • This method is triggered when a trait callback has been activated

    Type Parameters

    • RT = any

    • Payload = any

    Parameters

    • callbackName: string

      This is the name of the callback function to call.

    • datasourceWrapper: DataSourceWrapper

      References to the Graph Hanlder

    • data: TraitDataObject<RT, Payload, Promise<any>>

      Request data passed along as part of the request.

    Returns Promise<RT>

Generated using TypeDoc