diff options
author | charlieablett <cablett@gitlab.com> | 2019-08-28 06:47:29 +0300 |
---|---|---|
committer | charlieablett <cablett@gitlab.com> | 2019-10-23 05:40:17 +0300 |
commit | c57fc849060cbfe0ff5abd3fdc2ca32adbc35790 (patch) | |
tree | f41d361f14136af095a6ee1d478ca004b5d9fb1a /lib/gitlab | |
parent | 1689559facc7d50130c11c8fdc496641f719ae75 (diff) |
Allow tests to ignore recursion
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/graphql/query_analyzers/recursion_analyzer.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/graphql/query_analyzers/recursion_analyzer.rb b/lib/gitlab/graphql/query_analyzers/recursion_analyzer.rb index 70d4672d079..ccf9e597307 100644 --- a/lib/gitlab/graphql/query_analyzers/recursion_analyzer.rb +++ b/lib/gitlab/graphql/query_analyzers/recursion_analyzer.rb @@ -45,13 +45,17 @@ module Gitlab def recursion_too_deep?(node_name, times_encountered) return if IGNORED_FIELDS.include?(node_name) - times_encountered > RECURSION_THRESHOLD + times_encountered > recursion_threshold end def skip_node?(irep_node) ast_node = irep_node.ast_node !ast_node.is_a?(GraphQL::Language::Nodes::Field) || ast_node.selections.empty? end + + def recursion_threshold + RECURSION_THRESHOLD + end end end end |