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-1.13.16 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.0.13 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.0.12 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.13.15 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.0.11 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.13.14 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.13.13 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.0.9 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.0.8 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.0.7 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql_cody-1.13.0 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.13.12 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.0.6 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.0.5 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.0.4 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.0.3 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.13.11 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.0.2 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-2.0.1 lib/graphql/static_validation/rules/fragments_are_finite.rb
graphql-1.13.10 lib/graphql/static_validation/rules/fragments_are_finite.rb