Sha256: 2e8b8f21ece8ef0c77cd4a6f4df8b815bec93e25ac6f70fff516cb16d15c1648
Contents?: true
Size: 699 Bytes
Versions: 87
Compression:
Stored size: 699 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 subject.max_complexity.nil? total_complexity = max_possible_complexity if total_complexity > subject.max_complexity GraphQL::AnalysisError.new("Query has complexity of #{total_complexity}, which exceeds max complexity of #{subject.max_complexity}") else nil end end end end end end
Version data entries
87 entries across 87 versions & 2 rubygems