Sha256: ce38581f607fa818e86f0f74ecfedeb41c72a9bfe58a9bfbc087b57dfc43b5e5
Contents?: true
Size: 675 Bytes
Versions: 8
Compression:
Stored size: 675 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 = super 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
8 entries across 8 versions & 1 rubygems