Sha256: 2d55da753167a3fbf6a6ec5e0d178436ae00777b498fcfe5b38e3db2d72551f1

Contents?: true

Size: 637 Bytes

Versions: 71

Compression:

Stored size: 637 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  module StaticValidation
    module FragmentsAreFinite
      def on_document(_n, _p)
        super
        dependency_map = context.dependencies
        dependency_map.cyclical_definitions.each do |defn|
          if defn.node.is_a?(GraphQL::Language::Nodes::FragmentDefinition)
            context.errors << GraphQL::StaticValidation::FragmentsAreFiniteError.new(
              "Fragment #{defn.name} contains an infinite loop",
              nodes: defn.node,
              path: defn.path,
              name: defn.name
            )
          end
        end
      end
    end
  end
end

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
graphql-1.11.6 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.11.5 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.11.4 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.11.3 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.11.2 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.10.14 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.11.1 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.10.13 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.11.0 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.10.12 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.9.21 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.10.11 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.9.20 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.10.10 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.10.9 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.10.8 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.10.7 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.10.6 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.10.5 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.10.4 lib/graphql/static_validation/rules/fragments_are_finite.rb