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.12.17 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.12.16 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.12.15 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.12.14 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.12.13 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.12.12 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.12.11 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.12.10 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.12.9 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.12.8 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.12.7 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.12.6 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.12.5 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.11.8 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.12.4 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.12.3 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.12.2 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.12.1 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.12.0 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.11.7 lib/graphql/static_validation/rules/fragments_are_finite.rb