Drop Schema via cURL

In this post Drop all data from Dgraph the solution was to call curl -X POST localhost:8080/alter -d '{"drop_op": "DATA"}'

but that doesn’t work anymore

I go to Ratel and bulk edit, but Apply Schema does not apply the schema.

There’s also a drop schema option here, but it doesn’t work as well.

Why even have this option if it can’t be used?

I have to resort to manually dropping each predicate in the Ratel ui.


There must be a better way right?! The documentation on this is extremely poor, and discussion threads are outdated & don’t offer a working solution.

There doesn’t seem to be a way to programmatically drop the entire schema using cURL.

Are you authenticated? If so, you probably using a shared instance in the cloud. As far I remember, a tenant user can’t drop the data. Cuz that would delete everybody else’s data in the process.

Ah yes I am indeed using a shared tenant, didn’t realize it was the same Dgraph database we’re sharing, thought was just the machine.

Then I suppose a feature for dropping all of one’s schema on Dgraph shared instance would be great

I’m not 100% sure if the instance you are using is shared. But the majority I think it is. One way of doing it is doing an Upsert Mutation. To search and delete all existing nodes of your DB.