Sha256: 04151b6e16c2c8a43d1a1cb096ed04845a9ea2833f654fbf5e048f27fe5879cb
Contents?: true
Size: 612 Bytes
Versions: 24
Compression:
Stored size: 612 Bytes
Contents
# frozen_string_literal: true module GraphQL module Analysis # 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
Version data entries
24 entries across 24 versions & 1 rubygems