Sha256: 1c2971a6c2a81a81edb736d07bec7f3d68e704045212baa102c994c1b996d032

Contents?: true

Size: 507 Bytes

Versions: 24

Compression:

Stored size: 507 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  module Analysis
    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

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
graphql-2.4.8 lib/graphql/analysis/max_query_depth.rb
graphql-2.4.7 lib/graphql/analysis/max_query_depth.rb
graphql-2.4.6 lib/graphql/analysis/max_query_depth.rb
graphql-2.4.5 lib/graphql/analysis/max_query_depth.rb
graphql-2.4.4 lib/graphql/analysis/max_query_depth.rb
graphql-2.4.3 lib/graphql/analysis/max_query_depth.rb
graphql-2.4.2 lib/graphql/analysis/max_query_depth.rb
graphql-2.4.1 lib/graphql/analysis/max_query_depth.rb
graphql-2.4.0 lib/graphql/analysis/max_query_depth.rb
graphql-2.3.20 lib/graphql/analysis/max_query_depth.rb
graphql-2.3.19 lib/graphql/analysis/max_query_depth.rb
graphql-2.3.18 lib/graphql/analysis/max_query_depth.rb
graphql-2.3.17 lib/graphql/analysis/max_query_depth.rb
graphql-2.3.16 lib/graphql/analysis/max_query_depth.rb
graphql-2.3.15 lib/graphql/analysis/max_query_depth.rb
graphql-2.3.14 lib/graphql/analysis/max_query_depth.rb
graphql-2.3.13 lib/graphql/analysis/max_query_depth.rb
graphql-2.3.12 lib/graphql/analysis/max_query_depth.rb
graphql-2.3.11 lib/graphql/analysis/max_query_depth.rb
graphql-2.3.10 lib/graphql/analysis/max_query_depth.rb