10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/graphql/static_validation/rules/directives_are_defined.rb', line 10
def on_directive(node, parent)
if !@directive_names.include?(node.name)
@directives_are_defined_errors_by_name ||= {}
error = @directives_are_defined_errors_by_name[node.name] ||= begin
err = GraphQL::StaticValidation::DirectivesAreDefinedError.new(
"Directive @#{node.name} is not defined",
nodes: [],
directive: node.name
)
add_error(err)
err
end
error.nodes << node
else
super
end
end
|