Sha256: c1bf87f45328dcd1f4087d5f8faeba72c54f81c2f8d8bcaed42f6eca26525244
Contents?: true
Size: 651 Bytes
Versions: 68
Compression:
Stored size: 651 Bytes
Contents
# frozen_string_literal: true module GraphQL module StaticValidation class FragmentsAreFinite include GraphQL::StaticValidation::Message::MessageHelper def validate(context) context.visitor[GraphQL::Language::Nodes::Document].leave << ->(_n, _p) do dependency_map = context.dependencies dependency_map.cyclical_definitions.each do |defn| if defn.node.is_a?(GraphQL::Language::Nodes::FragmentDefinition) context.errors << message("Fragment #{defn.name} contains an infinite loop", defn.node, path: defn.path) end end end end end end end
Version data entries
68 entries across 68 versions & 1 rubygems