Commit e300fad5 authored by Alex Kalderimis's avatar Alex Kalderimis

Fix complexity calculation to allow gitaly call detection

This was erroneously setting constant_complexity to true for all fields
that have a resolver, since our BaseResolver sets complexity to 0 (and
`!!zero == true`).

This masks gitaly calls.
parent 0d510961
......@@ -11,7 +11,7 @@ module Types
def initialize(**kwargs, &block)
@calls_gitaly = !!kwargs.delete(:calls_gitaly)
@constant_complexity = !!kwargs[:complexity]
@constant_complexity = kwargs[:complexity].is_a?(Integer) && kwargs[:complexity] > 0
@requires_argument = !!kwargs.delete(:requires_argument)
kwargs[:complexity] = field_complexity(kwargs[:resolver_class], kwargs[:complexity])
@feature_flag = kwargs[:feature_flag]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment