API Reference / @evolu/common / Evolu/Internal / insertable
Function: insertable()
function insertable<Props>(props): ValidMutationSize<InsertableProps<Props>>;
Defined in: packages/common/src/Evolu/Schema.ts:320
Type Factory to create insertable Type. It makes nullable Types optional, omits Id, and ensures the maxMutationSize.
Example
const InsertableTodo = insertable(Schema.todo);
type InsertableTodo = typeof InsertableTodo.Type;
const todo = InsertableTodo.from({ title });
if (!todo.ok) return; // handle errors
Type Parameters
Type Parameter |
---|
Props extends Record <string , AnyType > |
Parameters
Parameter | Type |
---|---|
props | Props |
Returns
ValidMutationSize
<InsertableProps
<Props
>>