Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2019-05-08 11:46:56 +0300
committerSean McGivern <sean@gitlab.com>2019-05-08 11:46:56 +0300
commit9f888c7440a99f0c9bd59ac066fae88e7c863e41 (patch)
tree83f534032d8098414de3a3957f3a591e4e412e52 /spec/support
parent69cfdfaed3e5a63bc8af39ca4b42c932db1b7f75 (diff)
parentf80f68d520b98ae60300ecf0758ff241218e9cd0 (diff)
Merge branch '58404-set-default-max-depth-for-GraphQL' into 'master'
58404 - setup max depth for graphql Closes #58404 See merge request gitlab-org/gitlab-ce!25737
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/helpers/graphql_helpers.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/support/helpers/graphql_helpers.rb b/spec/support/helpers/graphql_helpers.rb
index b49d743fb9a..f15944652fd 100644
--- a/spec/support/helpers/graphql_helpers.rb
+++ b/spec/support/helpers/graphql_helpers.rb
@@ -102,6 +102,7 @@ module GraphqlHelpers
def all_graphql_fields_for(class_name, parent_types = Set.new)
allow_unlimited_graphql_complexity
+ allow_unlimited_graphql_depth
type = GitlabSchema.types[class_name.to_s]
return "" unless type
@@ -190,4 +191,9 @@ module GraphqlHelpers
allow_any_instance_of(GitlabSchema).to receive(:max_complexity).and_return nil
allow(GitlabSchema).to receive(:max_query_complexity).with(any_args).and_return nil
end
+
+ def allow_unlimited_graphql_depth
+ allow_any_instance_of(GitlabSchema).to receive(:max_depth).and_return nil
+ allow(GitlabSchema).to receive(:max_query_depth).with(any_args).and_return nil
+ end
end