Instructor: 00:00 To delete product, we must have delete product mutation. I am going to create a new mutation, deleteProduct. It will accept the ID. I want to return the deleted product in the response. The return type of the deleteProduct mutation is product.
00:14 Let's create the resolvers. I am going to create a new resolver, which is deleteProduct. It will accept ID as the argument. I am going to destructure the ID. There's a method here, findByID. Let me add comma here, findByID, and remove. We need to provide the ID here. That's it.
00:37 I've got the error, "Delete product defined in resolver but not in the schema." Oops, here we have E. We need to define E here. Let's try to test it. Let me check the docs. We have delete product mutation! I would like to delete the product. Let me copy the ID.
00:54 I would like to delete the sales course. Delete product. We need to provide the ID here. I want to see the ID name and qty in the response. Incredible. A product is deleted successfully. Here, we have sales course. Let's try to find all the products. I want to see ID and name. Boom, there is no sails.js course here.