TodoItemDTO
todo-item.dto.ts
-
createOneTodoItem- graphql endpoint to create a single record. -
createManyTodoItems- graphql endpoint to create multiple records, -
updateOneTodoItem- graphql endpoint to update a single record by id. -
updateManyTodoItems- graphql endpoint update multiple records with a filter, -
deleteOneTodoItem- graphql endpoint to delete one record by id. -
deleteManyTodoItems- graphql endpoint to delete multiple records with a filter.
Create One
TheCRUDResolver will by default expose a createOne mutation using the name of the DTO to name the mutation.
In this example we create a single TodoItem, the input by default will be a Partial of the DTO.
- GraphQL
- Response
Create Many
TheCRUDResolver will by default expose a createMany mutation using the name of the DTO to name the mutation.
In this example we create multiple TodoItems, the each record is a Partial of the DTO.
Examples
The following example creates twoTodoItems.
- GraphQL
- Response
Update One
TheCRUDResolver will by default expose an updateOne mutation that takes two fields:
id: The id of the record to update.update: The values to update on the record. This is a partial so you only have to pass in the values you want to change.
Examples
The following example updates the record withid equal to 1 to completed=true
- GraphQL
- Response
Update Many
TheCRUDResolver will by default expose an updateMany mutation that takes two fields:
filter: The filter to use to find the records to update.- NOTE The filter CANNOT be an empty object. This prevents accidental updating of all records.
update: The values to update on the record. This is a partial so you only have to pass in the values you want to change.
Examples
The following example updates records with anid equal to 1 or 2 to completed=true.
- GraphQL
- Response
Delete One
TheCRUDResolver will by default expose a deleteOne mutation that allows you to delete a record by id:
Examples
The following example deletes the record with an id equal to 1.- GraphQL
- Response
Delete Many
The CRUDResolver will by default expose adeleteMany mutation that takes a filter:
NOTE The filter CANNOT be an empty object. This prevents accidental deletion of all records.
Examples
The following example deletes all records that start withCreate Many Todo Items.
- GraphQL
- Response