Class UpdateMutator<TFields, TID, TViewerContext, TEntity, TPrivacyPolicy, TSelectedFields>

Mutator for updating an existing entity.

Type Parameters

Hierarchy

Constructors

Properties

companionProvider: EntityCompanionProvider
databaseAdapter: EntityDatabaseAdapter<TFields>
entityConfiguration: EntityConfiguration<TFields>
metricsAdapter: IEntityMetricsAdapter
privacyPolicy: TPrivacyPolicy
queryContext: EntityQueryContext
viewerContext: TViewerContext

Methods

  • Set the value for entity field.

    Type Parameters

    • K extends string | number | symbol

    Parameters

    • fieldName: K

      entity field being updated

    • value: TFields[K]

      value for entity field

    Returns this

  • Commit the changes to the entity after authorizing against update privacy rules. Invalidates all caches for pre-update entity.

    Returns Promise<Result<TEntity>>

    authorized updated entity result, where result error can be UnauthorizedError