Private Readonly accessPrivate Readonly dataPrivate Readonly gPrivate Readonly graphPrivate 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 Rating of a given entity.
Entity type (vertex label).
Entity ID.
Private addThe addSomethingRating mutation resolver.
Refer AddRemoveRatingMutationResolver for arguments and return value types.
Rest ...__namedParameters: [schemaItem: SchemaItem<"vertex">, entityType: string, instance: RatingBehaviourInstanceConfig, params: [source: null, args: { Private avgCalculates an average of ratings for a given entity.
The ratings average.
Tenant ID.
Entity type (vertex label).
Entity ID.
Private getRetrieves UUID of Rating of a given entity.
Rating 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 ratedThe ratedByConnection field resolver.
Refer RetrieveRatedByConnectionResolver for arguments and return value types.
Rest ...__namedParameters: [schemaItem: SchemaItem<"vertex">, entityType: string, instance: RatingBehaviourInstanceConfig, params: [source: ItemWithId, args: {}, context: KosmosUserContext<object>, info: GraphQLResolveInfo]]Private ratedPrivate ratedThe rated field resolver.
Refer RetrieveCurrentUserRatedResolver for arguments and return value types.
Rest ...__namedParameters: [schemaItem: SchemaItem<"vertex">, entityType: string, instance: RatingBehaviourInstanceConfig, params: [source: ItemWithId, args: {}, context: KosmosUserContext<object>, info: GraphQLResolveInfo]]Private ratingThe ratingAvg field resolver.
Refer RetrieveRatingAvgResolver for arguments and return value types.
Rest ...__namedParameters: [schemaItem: SchemaItem<"vertex">, entityType: string, instance: RatingBehaviourInstanceConfig, params: [source: ItemWithId, args: {}, context: KosmosUserContext<object>, info: GraphQLResolveInfo]]Private removeRemoves Rating of a given entity.
Entity type (vertex label).
Entity ID.
Private removeThe RemoveSomethingRating mutation resolver.
Refer AddRemoveRatingMutationResolver for arguments and return value types.
Rest ...__namedParameters: [schemaItem: SchemaItem<"vertex">, entityType: string, instance: RatingBehaviourInstanceConfig, params: [source: null, args: { Private updateUpdates Rating by a given id.
Edge ID.
The user/request context.
Private userProvides user rating.
User rating or null if it doesn't exist.
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
Rating Behaviour adds rating functionality.
Usage (
config.yml):