Sha256: 1268712732f99fd339697cd6d3b567d2def009d00413f18d51057cd872d77706
Contents?: true
Size: 693 Bytes
Versions: 13
Compression:
Stored size: 693 Bytes
Contents
# frozen_string_literal: true require_relative "./query_complexity" module GraphQL module Analysis module AST # Used under the hood to implement complexity validation, # see {Schema#max_complexity} and {Query#max_complexity} class MaxQueryComplexity < QueryComplexity def result return if query.max_complexity.nil? total_complexity = max_possible_complexity if total_complexity > query.max_complexity GraphQL::AnalysisError.new("Query has complexity of #{total_complexity}, which exceeds max complexity of #{query.max_complexity}") else nil end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems