Class: GraphQL::StaticValidation::FragmentsAreFinite
- Inherits:
-
Object
- Object
- GraphQL::StaticValidation::FragmentsAreFinite
- Includes:
- Message::MessageHelper
- Defined in:
- lib/graphql/static_validation/rules/fragments_are_finite.rb
Instance Method Summary collapse
Methods included from Message::MessageHelper
Instance Method Details
#validate(context) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/graphql/static_validation/rules/fragments_are_finite.rb', line 4 def validate(context) context.visitor[GraphQL::Language::Nodes::FragmentDefinition] << -> (node, parent) { if has_nested_spread(node, [], context) context.errors << ("Fragment #{node.name} contains an infinite loop", node) end } end |