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

**URL:** <https://discuss.dgraph.io/t/how-can-we-secure-the-graphql-api-from-malicious-queries-in-dgraph/14568>\
**Category:** GraphQL\
**Tags:** graphql, kind:question, dgraph\
**Created:** [June 12, 2021, 9:22am UTC](https://discuss.dgraph.io/t/how-can-we-secure-the-graphql-api-from-malicious-queries-in-dgraph/14568 "2021-06-12T09:22:08Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![pshaddel](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/pshaddel/32/11584_2.png) [@pshaddel](https://discuss.dgraph.io/u/pshaddel)\
**Post date:** [July 31, 2021, 6:33am UTC](https://discuss.dgraph.io/t/how-can-we-secure-the-graphql-api-from-malicious-queries-in-dgraph/14568/8 "2021-07-31T06:33:19Z")

</div>

I created this after I realized this is a bug:

> **[Bug: Cannot limit number of results using auth directive to prevent malicious...](https://discuss.dgraph.io/t/bug-cannot-limit-number-of-results-using-auth-directive-to-prevent-malicious-queries/14828)**
>
> We are trying to prevent users from requesting too many documents by setting a big number in first argument. What edition and version of Dgraph are you using? v21.03.1 Have you tried reproducing the issue with the latest release? Yes, the bug...

---

_[View the full topic](https://discuss.dgraph.io/t/how-can-we-secure-the-graphql-api-from-malicious-queries-in-dgraph/14568)._
