Sha256: a208f2d647f3af3e16f7cdfeba8e4cae468bb54286a9aacf1ec7c97563bfc7b4

Contents?: true

Size: 558 Bytes

Versions: 151

Compression:

Stored size: 558 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  module Analysis
    module AST
      class MaxQueryDepth < QueryDepth
        def result
          configured_max_depth = if query
            query.max_depth
          else
            multiplex.schema.max_depth
          end

          if configured_max_depth && @max_depth > configured_max_depth
            GraphQL::AnalysisError.new("Query has depth of #{@max_depth}, which exceeds max depth of #{configured_max_depth}")
          else
            nil
          end
        end
      end
    end
  end
end

Version data entries

151 entries across 151 versions & 2 rubygems

Version Path
graphql-2.2.16 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.1.13 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.3.5 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.0.31 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.3.2 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.3.1 lib/graphql/analysis/ast/max_query_depth.rb
graphql-1.13.23 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.3.0 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.2.14 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.2.13 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.2.12 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.0.29 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.1.12 lib/graphql/analysis/ast/max_query_depth.rb
graphql-1.13.22 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.2.11 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.2.10 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.2.9 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.2.8 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.2.7 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.2.6 lib/graphql/analysis/ast/max_query_depth.rb