How can we secure the GraphQL API from malicious queries in Dgraph?

I created this after I realized this is a bug: