diff options
Diffstat (limited to 'app/graphql/resolvers/base_resolver.rb')
-rw-r--r-- | app/graphql/resolvers/base_resolver.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/graphql/resolvers/base_resolver.rb b/app/graphql/resolvers/base_resolver.rb index b7502eb97c5..31850c2cadb 100644 --- a/app/graphql/resolvers/base_resolver.rb +++ b/app/graphql/resolvers/base_resolver.rb @@ -19,6 +19,13 @@ module Resolvers end def self.complexity_multiplier(args) + # When fetching many items, additional complexity is added to the field + # depending on how many items is fetched. For each item we add 1% of the + # original complexity - this means that loading 100 items (our default + # maxp_age_size limit) doubles the original complexity. + # + # Complexity is not increased when searching by specific ID(s), because + # complexity difference is minimal in this case. [args[:iid], args[:iids]].any? ? 0 : 0.01 end end |