Protected Optional _configTrait instance configuration.
Protected _globalWhether this is a global (not bound to any specific schema item) trait instance.
Protected Optional _typeTrait type.
Protected Readonly accessProtected Readonly behavioursProtected Readonly behavioursProtected Readonly behavioursProtected Readonly graphStatic Private hookedPrivate getPrivate getReturns name of GraphQL type corresponding BehavioursListResponseItem TS type.
The schema item label.
Private getReturns callback for the resolver callback to disable behaviour for a given schema item.
The GraphQL resolver callback instance.
The schema item.
Private getReturns callback for the resolver callback to enable behaviour for a given schema item.
The GraphQL resolver callback instance.
The schema item.
Private getReturns the list query resolver for a given schema item.
The GraphQL resolver callback instance.
The schema item.
Private getPrivate getAttaches Trait callbacks to schema item hooks.
Makes this Trait instance global.
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.
Configuration setter.
The new configuration.
Private wrapBehaviour resolver wrapper.
Retrieves and verifies behaviour instance configuration, then executes the Behaviour resolver, passing in runtime behaviour instance configuration.
Rest ...__namedParameters: [schemaItem: SchemaItem<SchemaItemType>, behaviourName: string, behaviourResolver: BehaviourGraphQlResolver<InstanceConfig<string>, any, Record<string, any>, Promise<any>, SchemaItemType>]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 Behaviours Trait.
Attaches all existing Behaviours to a given entity type, allows listing, enabling and disabling Behaviours.
TODO: Implement limiting Behaviours types per Behaviour Trait instance.Usage:
Mermaid
Services stack
Mermaid
Kosmos GraphQL server initialization
Mermaid
Listing Behaviours
Mermaid
Executing Behaviours queries/mutations
Mermaid
Enabling/Disabling Behaviours