Private Readonly _schemaPrivate Readonly dataPrivate Readonly gPrivate Readonly graphReturns Kosmos-side configuration for this Behaviour.
Sets Kosmos-side configuration for this Behaviour.
The new configuration object.
Returns behaviour machine name.
Private addAdds Like of a given entity.
Entity type (vertex label).
Entity ID.
The user/request context.
Optional userId: stringUser ID override; if not given, will be taken from context.
Private addThe addSomethingLike mutation resolver.
Refer AddRemoveLikeMutationResolver for arguments and return value types.
Rest ...params: [schemaItem: SchemaItem<"vertex">, entityType: string, instance: LikeBehaviourInstanceConfig, params: [source: null, args: { Private countPrivate getRetrieves UUID of Like of a given entity.
Like UUID or null if it doesn't exist.
User ID
Tenant ID.
Entity type (vertex label).
Entity ID.
Private getConstruct trait data object from different objects
Rest ...__namedParameters: [source: unknown, args: Record<string, any>, context: KosmosUserContext<object>, info: GraphQLResolveInfo]This method would be automatically before the first invocation of Behaviour for each entity type.
Behaviours may override this method, and it would be called once before each resolver.
Private likedThe likedByConnection field resolver.
Refer RetrieveLikedByConnectionResolver for arguments and return value types.
Rest ...__namedParameters: [schemaItem: SchemaItem<"vertex">, entityType: string, instance: LikeBehaviourInstanceConfig, params: [source: ItemWithId, args: {}, context: KosmosUserContext<object>, info: GraphQLResolveInfo]]Private likedPrivate likedThe liked field resolver.
Refer RetrieveCurrentUserLikeResolver for arguments and return value types.
Rest ...__namedParameters: [schemaItem: SchemaItem<"vertex">, entityType: string, instance: LikeBehaviourInstanceConfig, params: [source: ItemWithId, args: {}, context: KosmosUserContext<object>, info: GraphQLResolveInfo]]Private likesThe likesCount field resolver.
Refer RetrieveLikesCountResolver for arguments and return value types.
Rest ...__namedParameters: [schemaItem: SchemaItem<"vertex">, entityType: string, instance: LikeBehaviourInstanceConfig, params: [source: ItemWithId, args: {}, context: KosmosUserContext<object>, info: GraphQLResolveInfo]]Private removeRemoves Like of a given entity.
Entity type (vertex label).
Entity ID.
The user/request context.
Optional userId: stringUser ID override; if not given, will be taken from context.
Private removeThe RemoveSomethingLike mutation resolver.
Refer AddRemoveLikeMutationResolver for arguments and return value types.
Rest ...params: [schemaItem: SchemaItem<"vertex">, entityType: string, instance: LikeBehaviourInstanceConfig, params: [source: null, args: { Private userChecks if user likes content.
Whether user likes content.
User ID.
Tenant ID.
Entity type (vertex label).
Entity ID.
Validates runtime (e.g. ContentItem) configuration for this Behaviour.
Inherited classes may either return false for generic issues or throw BehaviourRuntimeError to return a specific error message.
The instance configuration value to check.
Validates Kosmos (e.g. build time) configuration for this Behaviour.
Inherited classes may either return false for generic issues or throw BehaviourConfigError to return a specific error message.
The Kosmos configuration value to check.
Generated using TypeDoc
Like Behaviour adds like/dislike functionality.
Usage (
config.yml):