markhuot / craftql

A drop-in GraphQL server for Craft CMS
Other
320 stars 53 forks source link

completely remove a entry #321

Open aquafun20 opened 5 years ago

aquafun20 commented 5 years ago

mutation removeArticle { upsertBlog(id: 123, enabled: false) { id } }

This disabled my entry. But how can I completely remove my entry?

narration-sd commented 5 years ago

First instinct is that you may not want to do this from GraphQL or any data api, because Entries have complex relations to other tables.

You could have a look at calling through Ajax Craft's EntriesController::actionDeleteEntry() to manage this properly, with the id, site, etc.. that you're interested in, and consider also user identity to be permitted to take such action...