Protected Optional _configTrait instance configuration.
Protected _globalWhether this is a global (not bound to any specific schema item) trait instance.
Protected Readonly _graphqlProtected Optional _typeTrait type.
Optional _userProtected Readonly dataProtected Readonly graphqlPrivate canValidate changing author against trait config
author of entity before update
entity id
kosmos user context
Private createPrivate deleteThis method is used to get the value of the GraphQL 'author' property
Attaches Trait callbacks to schema item hooks.
Private loadLoads related entity by definition object
Entity or null
description of relationships between vertices
kosmos user context
target entity
Makes this Trait instance global.
After the vertex has been created, add an edge pointing to its author.
The trait data
The data of the item that was created
Data source wrapper
User Context
Private postHandle transferring authorship of entity
The trait data
The data of the item that was updated
Legacy to be removed
User Context
This method is triggered when a trait callback has been activated
This is the name of the callback function to call.
References to the Graph Hanlder
Request data passed along as part of the request.
AuthorTrait config setter
This configuration object.
Private updateHelper method for wrapping legacy Kosmos traits callbacks.
TODO: Remove this method once all Traits are converted.
Optional callbackName: stringOptional callback name; passing this parameter will additionally wrap the callback into legacy process().
Static traitGenerated using TypeDoc
The Author trait adds
authorconnection field to GraphQL types.Usage:
Settings:
allow_change_author- allows to change author via update mutationcheck_membership- before updating author - compare membership of target entity and old author if it doesn't match - can update authorship. Works only ifallow_change_authoris true