From 4c121cb9f5d8480bb94fab298e577a82fcc7903f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Miedes=20Garc=C3=A9s?= Date: Thu, 6 Oct 2016 11:05:47 +0200 Subject: [PATCH] Reject deeply-nested queries --- app/graph/consul_schema.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/graph/consul_schema.rb b/app/graph/consul_schema.rb index bf05f48b9..47ef8a112 100644 --- a/app/graph/consul_schema.rb +++ b/app/graph/consul_schema.rb @@ -1,6 +1,9 @@ ConsulSchema = GraphQL::Schema.define do query QueryRoot + # Reject deeply-nested queries + max_depth 7 + resolve_type -> (object, ctx) { # look up types by class name type_name = object.class.name