Protected Optional _configTrait instance configuration.
Protected _globalWhether this is a global (not bound to any specific schema item) trait instance.
Optional _relationshipProtected Optional _typeTrait type.
Protected configPrivate dataPrivate dbPrivate graphqlPrivate schemaImplements alterUnions.
Adds a NotificationSource union with all the possible notification source types defined in the trait configuration, and an additional MissingEntity type for notifications that relate to deleted entities.
Note that enabling this trait on multiple schema types is not supported, and doing so will cause the union to be declared multiple times.
GraphQL resolver to get an entity object from the entity_id and
entity_type properties.
GraphQL resolver to get a user object from the message_from UUID.
Attaches Trait callbacks to schema item hooks.
GraphQL resolver to list the user's inbox messages.
Makes this Trait instance global.
Use the preDelete hook to clean up the deleted user's inbox from DynamoDB.
Implement this.
Used by traits for non user accessible entities
The UUID of vertex being deleted.
Datasource wrapper object.
The context of the user on whose behalf the call is being made.
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 is used to retrieve additions to the GraphQL schema and to register the callbacks associated to the Vertex.
Existing GraphQL schema.
String name of the source vertex that the trait is connected to (not used here)
Optional relationship: null | objectJSON Object of the relationship, can be null where trait is not attached to a relationship.
Configuration setter.
The new configuration.
GraphQL mutation resolver to mark a message as read or unread.
Since the read status is indexed in the partition key, we can't simply
overwrite the data.status property in place - we must write a new
record and delete the old one.
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
Inbox Trait adds global GraphQL Inbox query field listing user's notifications.
Usage:
The 'sources' configuration option specifies which entity types may be be referenced by an inbox notification. These will be used to build the NotificationSource union type. If omitted, the entity type to which the trait is attached will be used (normally this should be the User entity).