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.1.0 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.0.27 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.0.26 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.0.25 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.0.24 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.0.23 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.0.22 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.0.21 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.0.20 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.0.17.2 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.0.17.1 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.0.19 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.0.18 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.0.17 lib/graphql/analysis/ast/max_query_depth.rb
graphql-1.13.19 lib/graphql/analysis/ast/max_query_depth.rb
graphql-1.13.18 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.0.16 lib/graphql/analysis/ast/max_query_depth.rb
graphql-1.13.17 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.0.15 lib/graphql/analysis/ast/max_query_depth.rb
graphql-2.0.14 lib/graphql/analysis/ast/max_query_depth.rb