Deleting Resources (DELETE)

How to delete JSON:API resources using DrupalClient.


The deleteResource helper is available in next-drupal ^1.4.0.

The DrupalClient ships with a deleteResource method for deleting JSON:API resources.


Delete an article by id.

const deleted = await drupal.deleteResource(
"a937dd34-5407-4fff-8594-fccaaa5bb72a" // <-- Article ID

See the API reference for deleteResource.


To make authenticated requests when deleting resources, use the withAuth option.

See the authentication docs for the supported authentication methods.

const deleted = await drupal.deleteResource(
withAuth: // <-- Your auth method here.