API Reference / @evolu/common / Evolu/Internal / upsertable

Function: upsertable()

function upsertable<Props>(props): ValidMutationSize<NullableToOptionalProps<Props>>;

Defined in: packages/common/src/Evolu/Schema.ts:387

Type Factory to create upsertable Type. It makes nullable Types optional and ensures the maxMutationSize.

Example

const UpsertableTodo = upsertable(Schema.todo);
type UpsertableTodo = typeof UpsertableTodo.Type;
const todo = UpsertableTodo.from({ id, title });
if (!todo.ok) return; // handle errors

Type Parameters

Type Parameter
Props extends Record<string, AnyType>

Parameters

ParameterType
propsProps

Returns

ValidMutationSize<NullableToOptionalProps<Props>>

Was this page helpful?