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

Mutator for creating a new entity.

Type Parameters

Hierarchy

Constructors

Properties

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

Methods

  • Commit the new entity after authorizing against creation privacy rules. Invalidates all caches for queries that would return new entity.

    Returns Promise<Result<TEntity>>

    authorized, cached, newly-created entity result, where result error can be UnauthorizedError

  • 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