Sha256: 171f712d9671f94a330e885efc016375ea2c368b42726dc03dd03a5e61ffd495

Contents?: true

Size: 630 Bytes

Versions: 120

Compression:

Stored size: 630 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)
            add_error(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

120 entries across 120 versions & 2 rubygems

Version Path
graphql-2.4.4 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.4.3 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.4.2 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.4.1 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.4.0 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.3.20 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.3.19 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.3.18 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.3.17 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.3.16 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.3.15 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.3.14 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.3.13 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.3.12 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.3.11 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.3.10 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.2.16 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.1.13 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.3.9 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.3.8 lib/graphql/static_validation/rules/fragments_are_finite.rb