Skip to main content
Version: 0.24

Interface: CrudOperations

Mapping of CRUD operations to their options.

Each key enables the matching operation; an empty object enables it with Wasp's defaults.

The default implementations map directly to Prisma calls on the entity, and use the field marked with @id in the Prisma schema as the entity ID. Unless an operation is marked with CrudOperationOptions.isPublic, Wasp checks that an authenticated user is making the request.

CRUD operations are implemented with Wasp queries and actions. See Operations.

Propertiesโ€‹

create?โ€‹

optional create?: CrudOperationOptions

Defaultโ€‹

Entity.create({ data: args.data })


delete?โ€‹

optional delete?: CrudOperationOptions

Defaultโ€‹

Entity.delete({ where: { id: args.id } })


get?โ€‹

optional get?: CrudOperationOptions

Defaultโ€‹

Entity.findUnique({ where: { id: args.id } })


getAll?โ€‹

optional getAll?: CrudOperationOptions

Defaultโ€‹

Entity.findMany()


update?โ€‹

optional update?: CrudOperationOptions

Defaultโ€‹

Entity.update({ where: { id: args.id }, data: args.data })