Protected Optional _configTrait instance configuration.
Protected _dataProtected _globalWhether this is a global (not bound to any specific schema item) trait instance.
Protected _graphPrivate _propertiesPrivate _relationshipsProtected _schemaProtected Optional _typeTrait type.
Private Optional _uniqueUsed to define if the user can only create a single connection between the source and dest vertices. Here we default to false. An example use case would be for like connections where a user can only like a post once.
Protected Readonly accessPrivate _loadLoads connection source/destination entities.
This method which has been registered using the addMutationHandler() will be called from the super.process(), when the trait has been activated a connection will be created between the src and destination vertices.
Attaches Trait callbacks to schema item hooks.
Makes this Trait instance global.
This is where any GraphQL mutation entries that are rquired by the trait are added.
Returns graphql schema segment for inclusion in main graphql doc.
String name of the source vertex that the trait is connected to
Optional relationship: null | VertexRelationshipJSON Object of the relationship, can be null where trait is not attached to a relationship.
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.
This method which has been registered using the addMutationHandler() will be called from the super.process() when the trait has been activated the connection will be deleted is the user has valid access rights.
ConnectionTrait config setter.
Helper 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 Connection Trait is used to allow an edge the ability to add GraphQL mutation methods to an entity to add and remove connection between defined vertices.
Usage: