Interface EntityMutationTriggerConfiguration<TFields, TID, TViewerContext, TEntity, TSelectedFields>

Interface to define trigger behavior for entities.

interface EntityMutationTriggerConfiguration<
    TFields extends object,
    TID extends NonNullable<TFields[TSelectedFields]>,
    TViewerContext extends ViewerContext,
    TEntity extends
        ReadonlyEntity<TFields, TID, TViewerContext, TSelectedFields>,
    TSelectedFields extends keyof TFields = keyof TFields,
> {
    afterAll?: EntityMutationTrigger<
        TFields,
        TID,
        TViewerContext,
        TEntity,
        TSelectedFields,
    >[];
    afterCommit?: EntityNonTransactionalMutationTrigger<
        TFields,
        TID,
        TViewerContext,
        TEntity,
        TSelectedFields,
    >[];
    afterCreate?: EntityMutationTrigger<
        TFields,
        TID,
        TViewerContext,
        TEntity,
        TSelectedFields,
    >[];
    afterDelete?: EntityMutationTrigger<
        TFields,
        TID,
        TViewerContext,
        TEntity,
        TSelectedFields,
    >[];
    afterUpdate?: EntityMutationTrigger<
        TFields,
        TID,
        TViewerContext,
        TEntity,
        TSelectedFields,
    >[];
    beforeAll?: EntityMutationTrigger<
        TFields,
        TID,
        TViewerContext,
        TEntity,
        TSelectedFields,
    >[];
    beforeCreate?: EntityMutationTrigger<
        TFields,
        TID,
        TViewerContext,
        TEntity,
        TSelectedFields,
    >[];
    beforeDelete?: EntityMutationTrigger<
        TFields,
        TID,
        TViewerContext,
        TEntity,
        TSelectedFields,
    >[];
    beforeUpdate?: EntityMutationTrigger<
        TFields,
        TID,
        TViewerContext,
        TEntity,
        TSelectedFields,
    >[];
}

Type Parameters

Properties

afterAll?: EntityMutationTrigger<
    TFields,
    TID,
    TViewerContext,
    TEntity,
    TSelectedFields,
>[]

Trigger set that runs within the transaction but after the entity is created in, updated in, or deleted from the database and the cache is invalidated.

afterCommit?: EntityNonTransactionalMutationTrigger<
    TFields,
    TID,
    TViewerContext,
    TEntity,
    TSelectedFields,
>[]

Trigger set that runs after committing the mutation transaction. If the call to the mutation is wrapped in a transaction, these will be run after the wrapping transaction is completed.

afterCreate?: EntityMutationTrigger<
    TFields,
    TID,
    TViewerContext,
    TEntity,
    TSelectedFields,
>[]

Trigger set that runs within the transaction but after the entity is created in the database and cache is invalidated.

afterDelete?: EntityMutationTrigger<
    TFields,
    TID,
    TViewerContext,
    TEntity,
    TSelectedFields,
>[]

Trigger set that runs within the transaction but after the entity is deleted from the database and cache is invalidated.

afterUpdate?: EntityMutationTrigger<
    TFields,
    TID,
    TViewerContext,
    TEntity,
    TSelectedFields,
>[]

Trigger set that runs within the transaction but after the entity is updated in the database and cache is invalidated.

beforeAll?: EntityMutationTrigger<
    TFields,
    TID,
    TViewerContext,
    TEntity,
    TSelectedFields,
>[]

Trigger set that runs within the transaction but before the entity is created, updated, or deleted.

beforeCreate?: EntityMutationTrigger<
    TFields,
    TID,
    TViewerContext,
    TEntity,
    TSelectedFields,
>[]

Trigger set that runs within the transaction but before the entity is created in the database.

beforeDelete?: EntityMutationTrigger<
    TFields,
    TID,
    TViewerContext,
    TEntity,
    TSelectedFields,
>[]

Trigger set that runs within the transaction but before the entity is deleted from the database.

beforeUpdate?: EntityMutationTrigger<
    TFields,
    TID,
    TViewerContext,
    TEntity,
    TSelectedFields,
>[]

Trigger set that runs within the transaction but before the entity is updated in the database.