Can we drop queries if query time exceed a limit?

What I want to do

We do not want to let users run complex queries on the database. We are using dgraph GraphQL Layer.

Is there a config or way to prevent queries(For example queries that take more than 1 second)?
I do not mean setting this limit on the client side.

dgraph version Dgraph version : v21.03.1 Dgraph codename : rocket-1 Dgraph SHA-256 : a00b73d583a720aa787171e43b4cb4dbbf75b38e522f66c9943ab2f0263007fe Commit SHA-1 : ea1cb5f35 Commit timestamp : 2021-06-17 20:38:11 +0530 Branch : HEAD Go version : go1.16.2 jemalloc enabled : true

For Dgraph official documentation, visit https://dgraph.io/docs.
For discussions about Dgraph , visit http://discuss.dgraph.io.
For fully-managed Dgraph Cloud , visit https://dgraph.io/cloud.

Licensed variously under the Apache Public License 2.0 and Dgraph Community License.
Copyright 2015-2021 Dgraph Labs, Inc.

Hi, I believe you are looking for the alpha flag --limit 'query-timeout=1s'

I don’t see this in the docs, but in the code here

1 Like

Yes that is we want. Thank you dear @iluminae :+1: