Delete product
Remove a product from query results
deleteProduct
Soft-deletes a product by ID. The product remains in the database but is excluded from future query results.
Method
POST
Path
/graphql
Authentication
Bearer Token
Request Body Schema
Content-type: application/json
Variables
| Name | Type | Required | Description |
|---|---|---|---|
id | ID | Required | The product ID to delete |
Example Payload
{
"query": "mutation ($id: ID!) { deleteProduct(id: $id) { id partnumber } }",
"variables": {
"id": "2"
}
}
Response
Returns the deleted Product object.
Example Response
{
"data": {
"deleteProduct": {
"id": "2",
"partnumber": "WIDGET-001"
}
}
}
Errors
Example Response
{
"errors": [
{
"message": "Unauthenticated."
}
]
}
Method
POSTPath
/graphql